Пример #1
0
	void updateBitmapBgr32(uint8_t* pixels, int w, int h)
	{
		if(currentFrame == 0){
			FlogE("Video::updateBitmapBgr32() called but currentFrame is unset");
			throw VideoException(VideoException::EScaling);
		}

		AVPixelFormat fmt = PIX_FMT_RGB32;

		AVPicture pict;
		int avret = avpicture_fill(&pict, pixels, fmt, w, h);
		
		if(avret < 0){
			FlogE("avpicture_fill returned " << avret);
			throw VideoException(VideoException::EScaling);
		}
		
		currentFrame->CopyScaled(&pict, w, h, fmt);
	}
Пример #2
0
	void updateOverlay(uint8_t** pixels, const uint16_t* pitches, int w, int h)
	{
		if(currentFrame == 0){
			FlogE("Video::updateOverlay() called but currentFrame is unset");
			throw VideoException(VideoException::EScaling);
		}

		AVPicture pict;
		int avret = avpicture_fill(&pict, NULL, AV_PIX_FMT_YUYV422, w, h);

		if(avret < 0){
			FlogE("avpicture_fill returned " << avret);
			throw VideoException(VideoException::EScaling);
		}

		for(int i = 0; i < 3; i++){
			pict.data[i] = pixels[i];
			pict.linesize[i] = pitches[i];
		}

		currentFrame->CopyScaled(&pict, w, h, AV_PIX_FMT_YUYV422);
	}