Пример #1
0
void AVForm::showEvent(QShowEvent*)
{
    getAudioOutDevices();
    getAudioInDevices();
    createVideoSurface();
    getVideoDevices();
    Audio::getInstance().subscribeInput();
}
Пример #2
0
status_t MediaPlayer::prepareVideo()
{
	LOGI("prepareVideo");
	// Find the first video stream
	mVideoStreamIndex = -1;
	for (int i = 0; i < mMovieFile->nb_streams; i++) {
		if (mMovieFile->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {
			mVideoStreamIndex = i;
			break;
		}
	}
	
	if (mVideoStreamIndex == -1) {
		return INVALID_OPERATION;
	}
	
	AVStream* stream = mMovieFile->streams[mVideoStreamIndex];
	// Get a pointer to the codec context for the video stream
	AVCodecContext* codec_ctx = stream->codec;
	AVCodec* codec = avcodec_find_decoder(codec_ctx->codec_id);
	if (codec == NULL) {
		return INVALID_OPERATION;
	}
	
	// Open codec
	if (avcodec_open(codec_ctx, codec) < 0) {
		return INVALID_OPERATION;
	}
	
	mVideoWidth = codec_ctx->width;
	mVideoHeight = codec_ctx->height;
	mDuration =  mMovieFile->duration;
	
	mConvertCtx = sws_getContext(mVideoWidth,
								 mVideoHeight,
								 stream->codec->pix_fmt,
								 mVideoWidth,
								 mVideoHeight,
								 PIX_FMT_RGB565,
								 SWS_POINT,
								 NULL,
								 NULL,
								 NULL);

	if (mConvertCtx == NULL) {
		return INVALID_OPERATION;
	}

	if(!createVideoSurface(mVideoWidth, mVideoHeight)) {
		return INVALID_OPERATION;
	}

	return NO_ERROR;
}
Пример #3
0
void AVForm::showEvent(QShowEvent* event)
{
    getAudioOutDevices();
    getAudioInDevices();
    createVideoSurface();
    getVideoDevices();

    if (!subscribedToAudioIn) {
        // TODO: this should not be done in show/hide events
        Audio::getInstance().subscribeInput();
        subscribedToAudioIn = true;
    }

    GenericForm::showEvent(event);
}
Пример #4
0
void AVForm::present()
{
    getAudioOutDevices();
    getAudioInDevices();

    createVideoSurface();
    CamVideoSurface->setSource(Camera::getInstance());

    Camera::getInstance()->probeProp(Camera::SATURATION);
    Camera::getInstance()->probeProp(Camera::CONTRAST);
    Camera::getInstance()->probeProp(Camera::BRIGHTNESS);
    Camera::getInstance()->probeProp(Camera::HUE);
    Camera::getInstance()->probeResolutions();
	
	bodyUI->videoModescomboBox->blockSignals(true);
	bodyUI->videoModescomboBox->addItem(tr("Initializing Camera..."));
	bodyUI->videoModescomboBox->blockSignals(false);
}
Пример #5
0
StopmotionMonitor::StopmotionMonitor(MonitorManager *manager, QWidget *parent) :
    AbstractMonitor(Kdenlive::stopmotionMonitor, manager, parent),
    m_captureDevice(NULL)
{
    createVideoSurface();
}
Пример #6
0
void AVForm::showEvent(QShowEvent *)
{
    createVideoSurface();
    CamVideoSurface->setSource(Camera::getInstance());
}