164 lines
5.9 KiB
Diff
164 lines
5.9 KiB
Diff
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-avcodec-wrapper.c qutecom-2.2.1/wifo/phapi/phcodec-avcodec-wrapper.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-avcodec-wrapper.c 2014-05-15 14:34:08.441269093 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-avcodec-wrapper.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -53,9 +53,6 @@
|
|
|
|
void ph_avcodec_wrapper_init()
|
|
{
|
|
-#if LIBAVCODEC_VERSION_MAJOR < 54
|
|
- avcodec_init();
|
|
-#endif
|
|
avcodec_register_all();
|
|
}
|
|
|
|
@@ -64,9 +61,13 @@
|
|
|
|
int dec_len, got_picture = 0;
|
|
ph_avcodec_decoder_ctx_t * decoder_t = (ph_avcodec_decoder_ctx_t *) ctx;
|
|
-
|
|
- dec_len = avcodec_decode_video(decoder_t->context,
|
|
- dst, &got_picture, (uint8_t *)src, srcsize);
|
|
+ AVPacket avpkt;
|
|
+ av_init_packet(&avpkt);
|
|
+ avpkt.data = (uint8_t *)src;
|
|
+ avpkt.size = srcsize;
|
|
+ avpkt.flags = AV_PKT_FLAG_KEY;
|
|
+ dec_len = avcodec_decode_video2(decoder_t->context,
|
|
+ dst, &got_picture, &avpkt);
|
|
|
|
if (got_picture)
|
|
{
|
|
@@ -95,7 +96,7 @@
|
|
dest_width = PHMEDIA_VIDEO_FRAME_WIDTH;
|
|
dest_height = PHMEDIA_VIDEO_FRAME_HEIGHT;
|
|
|
|
- encoder_t->context = avcodec_alloc_context();
|
|
+ encoder_t->context = avcodec_alloc_context3(NULL);
|
|
encoder_t->encoder = avcodec_find_encoder(
|
|
meta_t->avcodec_encoder_id);
|
|
|
|
@@ -144,7 +145,7 @@
|
|
dest_height = PHMEDIA_VIDEO_FRAME_HEIGHT;
|
|
|
|
|
|
- decoder_t->context = avcodec_alloc_context();
|
|
+ decoder_t->context = avcodec_alloc_context3(NULL);
|
|
decoder_t->pictureIn = avcodec_alloc_frame();
|
|
|
|
decoder_t->decoder = avcodec_find_decoder(meta_t->avcodec_decoder_id);
|
|
@@ -159,7 +160,7 @@
|
|
//decoder_t->context->dsp_mask = (FF_MM_MMX|FF_MM_MMXEXT|FF_MM_SSE|FF_MM_SSE2);
|
|
decoder_t->context->idct_algo = FF_IDCT_AUTO;
|
|
|
|
- if (avcodec_open(decoder_t->context, decoder_t->decoder) < 0)
|
|
+ if (avcodec_open2(decoder_t->context, decoder_t->decoder, NULL) < 0)
|
|
{
|
|
return -1;
|
|
}
|
|
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-h263.c qutecom-2.2.1/wifo/phapi/phcodec-h263.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-h263.c 2014-05-15 14:34:08.441269093 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-h263.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -76,6 +76,11 @@
|
|
}
|
|
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
|
+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
|
|
+ h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
|
+#else
|
|
+ av_opt_set_int(h263t->encoder_ctx.context->priv_data, "structured_slices", 1, 0);
|
|
+#endif
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
|
|
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
|
@@ -92,8 +97,8 @@
|
|
h263t->encoder_ctx.context->rc_buffer_size = DEFAULT_RATE * 64;
|
|
h263t->encoder_ctx.context->bit_rate = DEFAULT_RATE;
|
|
|
|
- if (avcodec_open(h263t->encoder_ctx.context,
|
|
- h263t->encoder_ctx.encoder) < 0)
|
|
+ if (avcodec_open2(h263t->encoder_ctx.context,
|
|
+ h263t->encoder_ctx.encoder, NULL) < 0)
|
|
{
|
|
return 0;
|
|
}
|
|
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-h263flv1.c qutecom-2.2.1/wifo/phapi/phcodec-h263flv1.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-h263flv1.c 2014-05-15 14:34:08.442269081 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-h263flv1.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -76,6 +76,11 @@
|
|
}
|
|
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
|
+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
|
|
+ h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
|
+#else
|
|
+ av_opt_set_int(h263t->encoder_ctx.context->priv_data, "structured_slices", 1, 0);
|
|
+#endif
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
|
|
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
|
@@ -92,8 +97,8 @@
|
|
h263t->encoder_ctx.context->rc_buffer_size = DEFAULT_RATE * 64;
|
|
h263t->encoder_ctx.context->bit_rate = DEFAULT_RATE;
|
|
|
|
- if (avcodec_open(h263t->encoder_ctx.context,
|
|
- h263t->encoder_ctx.encoder) < 0)
|
|
+ if (avcodec_open2(h263t->encoder_ctx.context,
|
|
+ h263t->encoder_ctx.encoder, NULL) < 0)
|
|
{
|
|
return 0;
|
|
}
|
|
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-h263plus.c qutecom-2.2.1/wifo/phapi/phcodec-h263plus.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-h263plus.c 2014-05-15 14:34:08.442269081 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-h263plus.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -69,6 +69,11 @@
|
|
}
|
|
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
|
+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
|
|
+ h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
|
+#else
|
|
+ av_opt_set_int(h263t->encoder_ctx.context->priv_data, "structured_slices", 1, 0);
|
|
+#endif
|
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
|
|
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
|
@@ -85,8 +90,8 @@
|
|
h263t->encoder_ctx.context->rc_buffer_size = DEFAULT_RATE * 64;
|
|
h263t->encoder_ctx.context->bit_rate = DEFAULT_RATE;
|
|
|
|
- if (avcodec_open(h263t->encoder_ctx.context,
|
|
- h263t->encoder_ctx.encoder) < 0)
|
|
+ if (avcodec_open2(h263t->encoder_ctx.context,
|
|
+ h263t->encoder_ctx.encoder, NULL) < 0)
|
|
{
|
|
return 0;
|
|
}
|
|
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-h264.c qutecom-2.2.1/wifo/phapi/phcodec-h264.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-h264.c 2014-05-15 14:34:08.442269081 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-h264.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -77,8 +77,8 @@
|
|
return 0;
|
|
}
|
|
|
|
- if (avcodec_open(h264t->encoder_ctx.context,
|
|
- h264t->encoder_ctx.encoder) < 0)
|
|
+ if (avcodec_open2(h264t->encoder_ctx.context,
|
|
+ h264t->encoder_ctx.encoder, NULL) < 0)
|
|
{
|
|
return -1;
|
|
}
|
|
diff -Nru qutecom-2.2.1.orig/wifo/phapi/phcodec-mpeg4.c qutecom-2.2.1/wifo/phapi/phcodec-mpeg4.c
|
|
--- qutecom-2.2.1.orig/wifo/phapi/phcodec-mpeg4.c 2014-05-15 14:34:08.443269070 +0000
|
|
+++ qutecom-2.2.1/wifo/phapi/phcodec-mpeg4.c 2014-05-15 14:34:37.222928237 +0000
|
|
@@ -96,8 +96,8 @@
|
|
mpeg4t->encoder_ctx.context->i_quant_factor = -0.8;
|
|
mpeg4t->encoder_ctx.context->thread_count = 1;
|
|
|
|
- if (avcodec_open(mpeg4t->encoder_ctx.context,
|
|
- mpeg4t->encoder_ctx.encoder) < 0)
|
|
+ if (avcodec_open2(mpeg4t->encoder_ctx.context,
|
|
+ mpeg4t->encoder_ctx.encoder, NULL) < 0)
|
|
{
|
|
return 0;
|
|
}
|