History

Deprecate AFD field and add AFD as side-data

Kieran Kunhya committed 12 years ago

Commit 2a3c36e1 parent 2793b217 files · +51 −4Browse files

Unified · Split

7 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +4 −1
  3. libavcodec/mpeg12dec.c +19 −1
  4. libavcodec/version.h +4 −1
  5. libavfilter/vf_showinfo.c +3 −0
  6. libavutil/frame.h +16 −0
  7. libavutil/version.h +1 −1
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2012-10-22 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2014-08-04 - xxxxxxx - lavc 55.72.101 - avcodec.h
19+2014-08-04 - xxxxxxx - lavu 52.95.100 - frame.h
20+ Deprecate AVCodecContext.dtg_active_format and use side-data instead
21+
1822 2014-08-03 - xxxxxxx - lavc 55.72.100 - avcodec.h
1923 Add get_pixels() to AVDCT
2024
libavcodec/avcodec.h+4−1
@@ -1690,6 +1690,7 @@ typedef struct AVCodecContext { · 1689 unmodified lines
16901690 */
16911691 int me_subpel_quality;
16921692
1693+#if FF_API_AFD
16931694 /**
16941695 * DTG active format information (additional aspect ratio
16951696 * information only used in DVB MPEG-2 transport streams)
@@ -1697,8 +1698,9 @@ typedef struct AVCodecContext { · 1 unmodified line
16971698 *
16981699 * - encoding: unused
16991700 * - decoding: Set by decoder.
1701+ * @deprecated Deprecated in favour of AVSideData
17001702 */
1701− int dtg_active_format;
1703+ attribute_deprecated int dtg_active_format;
17021704 #define FF_DTG_AFD_SAME 8
17031705 #define FF_DTG_AFD_4_3 9
17041706 #define FF_DTG_AFD_16_9 10
@@ -1706,6 +1708,7 @@ typedef struct AVCodecContext { · 1 unmodified line
17061708 #define FF_DTG_AFD_4_3_SP_14_9 13
17071709 #define FF_DTG_AFD_16_9_SP_14_9 14
17081710 #define FF_DTG_AFD_SP_4_3 15
1711+#endif
17091712
17101713 /**
17111714 * maximum motion estimation search range in subpel units
libavcodec/mpeg12dec.c+19−1
@@ -56,6 +56,8 @@ typedef struct Mpeg1Context { · 55 unmodified lines
5656 int has_stereo3d;
5757 uint8_t *a53_caption;
5858 int a53_caption_size;
59+ uint8_t afd;
60+ int has_afd;
5961 int slice_count;
6062 int save_aspect_info;
6163 int save_width, save_height, save_progressive_seq;
@@ -1659,6 +1661,18 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1597 unmodified lines
16591661 *stereo = s1->stereo3d;
16601662 s1->has_stereo3d = 0;
16611663 }
1664+
1665+ if (s1->has_afd) {
1666+ AVFrameSideData *sd = av_frame_new_side_data(
1667+ s->current_picture_ptr->f, AV_FRAME_DATA_AFD,
1668+ 1);
1669+ if (!sd)
1670+ return AVERROR(ENOMEM);
1671+
1672+ *sd->data = s1->afd;
1673+ s1->has_afd = 0;
1674+ }
1675+
16621676 if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
16631677 ff_thread_finish_setup(avctx);
16641678 } else { // second field
@@ -2264,6 +2278,7 @@ static void mpeg_decode_user_data(AVCodecContext *avctx, · 599 unmodified lines
22642278 {
22652279 Mpeg1Context *s = avctx->priv_data;
22662280 const uint8_t *buf_end = p + buf_size;
2281+ Mpeg1Context *s1 = avctx->priv_data;
22672282
22682283 if (buf_size > 29){
22692284 int i;
@@ -2290,7 +2305,11 @@ static void mpeg_decode_user_data(AVCodecContext *avctx, · 20 unmodified lines
22902305 if (flags & 0x40) {
22912306 if (buf_end - p < 1)
22922307 return;
2308+#if FF_API_AFD
22932309 avctx->dtg_active_format = p[0] & 0x0f;
2310+#endif
2311+ s1->has_afd = 1;
2312+ s1->afd = p[0] & 0x0f;
22942313 }
22952314 } else if (buf_end - p >= 6 &&
22962315 p[0] == 'J' && p[1] == 'P' && p[2] == '3' && p[3] == 'D' &&
@@ -2302,7 +2321,6 @@ static void mpeg_decode_user_data(AVCodecContext *avctx, · 5 unmodified lines
23022321 S3D_video_format_type == 0x04 ||
23032322 S3D_video_format_type == 0x08 ||
23042323 S3D_video_format_type == 0x23) {
2305− Mpeg1Context *s1 = avctx->priv_data;
23062324
23072325 s1->has_stereo3d = 1;
23082326
libavcodec/version.h+4−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
3232 #define LIBAVCODEC_VERSION_MINOR 72
33−#define LIBAVCODEC_VERSION_MICRO 100
33+#define LIBAVCODEC_VERSION_MICRO 101
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 LIBAVCODEC_VERSION_MINOR, \
@@ -168,5 +168,8 @@ · 131 unmodified lines
168168 #ifndef FF_API_CODEC_NAME
169169 #define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 57)
170170 #endif
171+#ifndef FF_API_AFD
172+#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 57)
173+#endif
171174
172175 #endif /* AVCODEC_VERSION_H */
libavfilter/vf_showinfo.c+3−0
@@ -147,6 +147,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 146 unmodified lines
147147 av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
148148 av_display_rotation_get((int32_t *)sd->data));
149149 break;
150+ case AV_FRAME_DATA_AFD:
151+ av_log(ctx, AV_LOG_INFO, "afd: value of %u", sd->data[0]);
152+ break;
150153 default:
151154 av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)",
152155 sd->type, sd->size);
libavutil/frame.h+16−0
@@ -82,6 +82,22 @@ enum AVFrameSideDataType { · 81 unmodified lines
8282 * See libavutil/display.h for a detailed description of the data.
8383 */
8484 AV_FRAME_DATA_DISPLAYMATRIX,
85+ /**
86+ * Active Format Description data consisting of a single byte as specified in ETSI TS 101 154
87+ * using AVActiveFormatDescription enum
88+ */
89+ AV_FRAME_DATA_AFD,
90+};
91+
92+enum AVActiveFormatDescription
93+{
94+ AV_AFD_SAME = 8,
95+ AV_AFD_4_3 = 9,
96+ AV_AFD_16_9 = 10,
97+ AV_AFD_14_9 = 11,
98+ AV_AFD_4_3_SP_14_9 = 13,
99+ AV_AFD_16_9_SP_14_9 = 14,
100+ AV_AFD_SP_4_3 = 15
85101 };
86102
87103 typedef struct AVFrameSideData {
libavutil/version.h+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 */
5757
5858 #define LIBAVUTIL_VERSION_MAJOR 52
59−#define LIBAVUTIL_VERSION_MINOR 94
59+#define LIBAVUTIL_VERSION_MINOR 95
6060 #define LIBAVUTIL_VERSION_MICRO 100
6161
6262 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t