⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audio_send.cpp

📁 视频会议源码
💻 CPP
字号:
///////////////////////////////////////////////////////// FileName:	audio_send.cpp// Author:		b1gm0use// Project:		myaudio#include <iostream>#include <qapplication.h>#include <string.h>#include "capture_event.h"#include "audio_send.h"#include "audio_cap.h"#include "audio.h"using namespace std;///////////////////////////////////////////////////////// Public Functions///////////////////////////////////////////////////////// 构造函数audio_send::audio_send ( void ) // {{{{	verbose_output( 2, "create audio_send" );	ap = NULL;	last_image[0] = last_image[1] = NULL;	frame = 0;} // }}}// 析构函数audio_send::~audio_send ( void ) // {{{{		delete [] last_image[0];		delete [] last_image[1];} // }}}	// 初始化函数int audio_send::init ( AudioPlayer * ap_in ) // {{{{	ap =  ap_in;	return 0;} // }}}// 发送捕捉图像完成的消息// 维护两个缓冲区,交替使用// 这个函数中的缓冲区有待优化int audio_send::send_image ( const BUFF * image, int size ) // {{{{	verbose_output( 2, "begin audio send." );		//开辟与获取图像大小相当的缓冲区	if ( NULL == last_image[frame] )	{		last_image[frame] = new BUFF[ size ];		if ( NULL == last_image[frame] )		{			cerr << "Can't alloc new memory" << endl;			exit( 1 );		}	}	verbose_output( 3, "readjust image buffer" );	memcpy( last_image[frame], image, size );	//发送消息	capture_event * event = new capture_event( AUDIO_EVENT, last_image[frame], size );	verbose_output( 3, "sending new image change event." );	QApplication::postEvent( (QObject *) ap, (QEvent *) event );	frame ^= 1;	return 0;} // }}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -