📄 network_audio_send.cpp
字号:
///////////////////////////////////////////////////////// FileName: network_audio_send.cpp// Author: b1gm0use// Project: myvideo#include <iostream>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <unistd.h>#include <qapplication.h>#include <qsemaphore.h>#include "network_audio_send.h"#include "network.h"#include "capture_event.h"#include "video.h"#include "avi.h"using namespace std;///////////////////////////////////////////////////////// Public Functions///////////////////////////////////////////////////////// 构造函数network_audio_send::network_audio_send ( avi * avi_ptr_in ) // {{{{ verbose_output( 2, "create network_audio_send" ); cfd = 0; last_buff = NULL; avi_ptr = avi_ptr_in;} // }}}network_audio_send::~network_audio_send ( void ) // {{{{ delete [] last_buff;} // }}}// 初始化函数int network_audio_send::init ( void ) // {{{{ verbose_output( 2, "init network_audio_send" ); last_buff = new BUFF [ MAX_AUDIO_BUFF_SIZE ]; return SUCCEED;} // }}} // 向网络上发送图像int network_audio_send::send_image ( const BUFF * buff, int size ) // {{{{ verbose_output( 2, "network_audio_send send_image" ); memcpy( last_buff, buff, size ); capture_event new_event( AUDIO_NET_SEND_EVENT, last_buff, size ); if ( NULL != avi_ptr->network_ctrl_ptr ) { (*(avi_ptr->send_image_semaphore))++; QApplication::sendEvent( (QObject *) avi_ptr->network_ctrl_ptr, (QEvent *) &new_event ); (*(avi_ptr->send_image_semaphore))--; } verbose_output( 3, "send audio frame ok" ); return SUCCEED;} // }}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -