summaryrefslogtreecommitdiffstats
path: root/transcode/transcode-ffmpeg.patch
blob: 310136d04638865bbd7ca183634f893808fd5b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Index: transcode-1.1.5/encode/encode_lavc.c
===================================================================
--- transcode-1.1.5.orig/encode/encode_lavc.c
+++ transcode-1.1.5/encode/encode_lavc.c
@@ -955,8 +955,6 @@ static void tc_lavc_config_defaults(TCLa
     /* 
      * context *transcode* (not libavcodec) defaults
      */
-    pd->ff_vcontext.mb_qmin                 = 2;
-    pd->ff_vcontext.mb_qmax                 = 31;
     pd->ff_vcontext.max_qdiff               = 3;
     pd->ff_vcontext.max_b_frames            = 0;
     pd->ff_vcontext.me_range                = 0;
@@ -1116,8 +1114,6 @@ static int tc_lavc_read_config(TCLavcPri
         //  handled by transcode core
         //  { "vqmax", PCTX(qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
         //  handled by transcode core
-        { "mbqmin", PCTX(mb_qmin), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
-        { "mbqmax", PCTX(mb_qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
         { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
         { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
         { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
Index: transcode-1.1.5/export/export_ffmpeg.c
===================================================================
--- transcode-1.1.5.orig/export/export_ffmpeg.c
+++ transcode-1.1.5/export/export_ffmpeg.c
@@ -643,8 +643,6 @@ MOD_init
 
     lavc_venc_context->bit_rate           = vob->divxbitrate * 1000;
     lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
-    lavc_venc_context->mb_qmin            = lavc_param_mb_qmin;
-    lavc_venc_context->mb_qmax            = lavc_param_mb_qmax;
     lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
     lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
     lavc_venc_context->max_qdiff          = lavc_param_vqdiff;
Index: transcode-1.1.5/import/decode_lavc.c
===================================================================
--- transcode-1.1.5.orig/import/decode_lavc.c
+++ transcode-1.1.5/import/decode_lavc.c
@@ -261,8 +261,12 @@ void decode_lavc(decode_t *decode)
 
       //tc_log_msg(__FILE__, "SIZE: (%d) MP4(%d) blen(%d) BUF(%d) read(%ld)", len, mp4_size, buf_len, READ_BUFFER_SIZE, bytes_read);
       do {
-	  len = avcodec_decode_video(lavc_dec_context, &picture,
-		  &got_picture, buffer+buf_len, mp4_size-buf_len);
+          AVPacket pkt;
+	  av_init_packet( &pkt );
+	  pkt.data = buffer+buf_len;
+	  pkt.size = mp4_size-buf_len;
+	  len = avcodec_decode_video2(lavc_dec_context, &picture,
+		  &got_picture, &pkt);
 
 	  if (len < 0) {
 	      tc_log_error(__FILE__, "frame decoding failed");
Index: transcode-1.1.5/import/probe_ffmpeg.c
===================================================================
--- transcode-1.1.5.orig/import/probe_ffmpeg.c
+++ transcode-1.1.5/import/probe_ffmpeg.c
@@ -47,7 +47,7 @@ static void translate_info(const AVForma
     for (i = 0; i < ctx->nb_streams; i++) {
         st = ctx->streams[i];
 
-        if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
+        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
             info->bitrate = st->codec->bit_rate / 1000;
             info->width = st->codec->width;
             info->height = st->codec->height;
@@ -65,7 +65,7 @@ static void translate_info(const AVForma
     for (i = 0; i < ctx->nb_streams; i++) {
         st = ctx->streams[i];
 
-        if (st->codec->codec_type == CODEC_TYPE_AUDIO
+        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO
          && j < TC_MAX_AUD_TRACKS) {
             info->track[j].format = 0x1; /* known wrong */
             info->track[j].chan = st->codec->channels;
Index: transcode-1.1.5/export/ffmpeg_cfg.c
===================================================================
--- transcode-1.1.5.orig/export/ffmpeg_cfg.c
+++ transcode-1.1.5/export/ffmpeg_cfg.c
@@ -34,8 +34,6 @@ int lavc_param_vme = 4;
 //int lavc_param_vqscale = 0;
 //int lavc_param_vqmin = 2;
 //int lavc_param_vqmax = 31;
-int lavc_param_mb_qmin = 2;
-int lavc_param_mb_qmax = 31;
 int lavc_param_lmin = 2;
 int lavc_param_lmax = 31;
 int lavc_param_vqdiff = 3;
@@ -140,8 +138,6 @@ TCConfigEntry lavcopts_conf[]={
 //    {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
 //    {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
 //    {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
-    {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
-    {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
     {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
     {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
     {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
Index: transcode-1.1.5/export/ffmpeg_cfg.h
===================================================================
--- transcode-1.1.5.orig/export/ffmpeg_cfg.h
+++ transcode-1.1.5/export/ffmpeg_cfg.h
@@ -13,8 +13,6 @@ extern int lavc_param_vme;
 //extern int lavc_param_vqscale;
 //extern int lavc_param_vqmin;
 //extern int lavc_param_vqmax;
-extern int lavc_param_mb_qmin;
-extern int lavc_param_mb_qmax;
 extern int lavc_param_lmin;
 extern int lavc_param_lmax;
 extern int lavc_param_vqdiff;