[FFmpeg-devel] [PATCH] Add support for parsing the Display Definition Segment in dvbsubdec.c
Michael Niedermayer
michaelni
Fri May 7 00:50:05 CEST 2010
On Thu, May 06, 2010 at 01:11:58AM +0200, Janne Grunau wrote:
> On Fri, Apr 23, 2010 at 03:41:09PM +0200, Michael Niedermayer wrote:
> > On Fri, Apr 23, 2010 at 09:05:03AM +0100, Ian Caulfield wrote:
> > > On 23 April 2010 05:05, Mark Kendall <mark.kendall at gmail.com> wrote:
> > > > The attached patch parses the Display Definition Segment in DVB
> > > > subtitle packets (see EN 300 743 V1.3.1).
> > > >
> > > > The Display Definition Segment explicitly indicates to the decoder the
> > > > display size for which the subtitles were generated, allowing standard
> > > > definition subtitles to be displayed on high definition streams.
> > > >
> > > > This extends AVSubtitleRect to hold the new display information and,
> > > > if a Display Definition Segment is not seen, defaults to 720x576 (per
> > > > the standard).
> > >
> > > Would it be more appropriate to fill in the width and height fields of
> > > AVCodecContext?
> >
> > agree,
> > with documentation added to width/height and where the x/y position is
> > documented
>
> modified patch attached. Also moved display_x/y to AVSubtitle since it's
> at least in the case of dvb subtitles for all rects identical. If we
> expect it to change per rect we can't store the size in AVCodecContext.
> Also bumped minor version, removed whitespace only changes and fixed
> off-by-one errors in the width/height calculation.
>
> Janne
>
> avcodec.h | 10 ++++++++-
> dvbsubdec.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 73 insertions(+), 1 deletion(-)
> dcde49dfda3c601c37db785edef94505562ea1f2 hd_dvb_subtitles2.diff
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index b643747..0abd53f 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -30,7 +30,7 @@
> #include "libavutil/avutil.h"
>
> #define LIBAVCODEC_VERSION_MAJOR 52
> -#define LIBAVCODEC_VERSION_MINOR 66
> +#define LIBAVCODEC_VERSION_MINOR 67
> #define LIBAVCODEC_VERSION_MICRO 0
>
> #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> @@ -1097,6 +1097,9 @@ typedef struct AVCodecContext {
> * picture width / height.
> * - encoding: MUST be set by user.
> * - decoding: Set by libavcodec.
> + * If set for subtitles width / height of the display region. The top
> + * left corner of the display region is specified in AVSubtitle as
> + * display_x, display_y.
> * Note: For compatibility it is possible to set this instead of
> * coded_width/height before decoding.
> */
> @@ -2863,6 +2866,11 @@ typedef struct AVSubtitle {
> unsigned num_rects;
> AVSubtitleRect **rects;
> int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
> + /**
> + * top left corner of region into which rects are displayed.
> + * display width and height are in AVCodecContext
> + */
> + int display_x, display_y;
the rectangles already contain x/y variables this is unneeded and
confusing
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100507/c2cde670/attachment.pgp>
More information about the ffmpeg-devel
mailing list