diff options
Diffstat (limited to 'ext/ffmpeg/gstffmpeg.c')
-rw-r--r-- | ext/ffmpeg/gstffmpeg.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/ext/ffmpeg/gstffmpeg.c b/ext/ffmpeg/gstffmpeg.c index 71e2b8a..5536f95 100644 --- a/ext/ffmpeg/gstffmpeg.c +++ b/ext/ffmpeg/gstffmpeg.c @@ -44,22 +44,20 @@ static GStaticMutex gst_avcodec_mutex = G_STATIC_MUTEX_INIT; int -gst_ffmpeg_avcodec_open (AVCodecContext * avctx, AVCodec * codec) +gst_ffmpeg_avcodec_open (AVCodecContext * avctx, AVCodec * codec, CodecExtraInfo *pInfo) { int ret = -1; g_static_mutex_lock (&gst_avcodec_mutex); - GST_CODEC_LOG("before avcodec_open!!\n"); - if (codec->type == AVMEDIA_TYPE_VIDEO) { - ret = emul_avcodec_open(avctx, codec); - GST_CODEC_LOG("[video] after emul_avcodec_open type:%d id:%d\n", - avctx->codec_type, avctx->codec_id) - } else { - ret = avcodec_open (avctx, codec); - GST_CODEC_LOG("[audio] after avcodec_open type:%d id:%d\n", - avctx->codec_type, avctx->codec_id) - } + GST_CODEC_LOG("before avcodec_open.\n") + GST_CODEC_LOG("extradata_size:%d\n", avctx->extradata_size) + + ret = emul_avcodec_open(avctx, codec, pInfo); + + GST_CODEC_LOG("after emul_avcodec_open type:%d id:%x\n", + avctx->codec_type, avctx->codec_id) + GST_CODEC_LOG("after avcodec_open!!, context index:%x\n", pInfo->contextIndex); if (ret < 0) { printf("[%s] Failed to open %d(ret:%d)\n", __func__, codec->id, ret); @@ -71,23 +69,19 @@ gst_ffmpeg_avcodec_open (AVCodecContext * avctx, AVCodec * codec) } int -gst_ffmpeg_avcodec_close (AVCodecContext * avctx) +gst_ffmpeg_avcodec_close (AVCodecContext * avctx, CodecExtraInfo *pInfo) { int ret; g_static_mutex_lock (&gst_avcodec_mutex); - if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { - GST_CODEC_LOG("video codec close\n"); - ret = emul_avcodec_close (avctx); - } else { - GST_CODEC_LOG("\n"); - ret = avcodec_close(avctx); - } + GST_CODEC_LOG("codec close, codec_type:%d, context index:%d\n", + avctx->codec_type, pInfo->contextIndex) + ret = emul_avcodec_close (avctx, pInfo); if (ret < 0) { - printf("[%]s Failed to close. %d(ret:%d)\n", - avctx->codec_id, ret); + printf("[%s] Failed to close. codec_id:%d ret:%d\n", + __func__, avctx->codec_id, ret); } g_static_mutex_unlock (&gst_avcodec_mutex); @@ -166,21 +160,22 @@ plugin_init (GstPlugin * plugin) av_register_all (); - emul_open_codecdev(); - emul_av_register_all(); - gst_ffmpegenc_register (plugin); gst_ffmpegdec_register (plugin); gst_ffmpegdemux_register (plugin); gst_ffmpegmux_register (plugin); +#if 0 gst_ffmpegdeinterlace_register (plugin); +#endif #if 0 gst_ffmpegscale_register (plugin); #endif #if 0 gst_ffmpegcsp_register (plugin); #endif +#if 0 gst_ffmpegaudioresample_register (plugin); +#endif register_protocol (&gstreamer_protocol); register_protocol (&gstpipe_protocol); |