From 12865d9947dbf9a0ecc91447032795558610e213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 29 Mar 2007 17:31:43 +0000 Subject: Allocate chunk_buffer when initialising the parser, rather than having it inline the ff_video_decoder_t struct. CVS patchset: 8763 CVS date: 2007/03/29 17:31:43 --- src/libffmpeg/mpeg_parser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libffmpeg/mpeg_parser.h') diff --git a/src/libffmpeg/mpeg_parser.h b/src/libffmpeg/mpeg_parser.h index 9cc12f380..449130c92 100644 --- a/src/libffmpeg/mpeg_parser.h +++ b/src/libffmpeg/mpeg_parser.h @@ -20,7 +20,7 @@ * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr) * based on libmpeg2 decoder. * - * $Id: mpeg_parser.h,v 1.2 2004/09/21 19:27:18 tmattern Exp $ + * $Id: mpeg_parser.h,v 1.3 2007/03/29 17:31:43 dgp85 Exp $ */ #ifndef HAVE_MPEG_PARSER_H #define HAVE_MPEG_PARSER_H @@ -39,7 +39,7 @@ typedef struct mpeg_parser_s { uint32_t shift; int is_sequence_needed; - uint8_t chunk_buffer[BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; + uint8_t *chunk_buffer; uint8_t *chunk_ptr; uint8_t *chunk_start; int buffer_size; -- cgit v1.2.3 From 13f031f44d75faabcdf21cf75ab08c8d66c61b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 29 Mar 2007 17:59:35 +0000 Subject: Add a dispose function to clean the allocated buffer. CVS patchset: 8765 CVS date: 2007/03/29 17:59:35 --- src/libffmpeg/mpeg_parser.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libffmpeg/mpeg_parser.h') diff --git a/src/libffmpeg/mpeg_parser.h b/src/libffmpeg/mpeg_parser.h index 449130c92..0b93b21e0 100644 --- a/src/libffmpeg/mpeg_parser.h +++ b/src/libffmpeg/mpeg_parser.h @@ -20,7 +20,7 @@ * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr) * based on libmpeg2 decoder. * - * $Id: mpeg_parser.h,v 1.3 2007/03/29 17:31:43 dgp85 Exp $ + * $Id: mpeg_parser.h,v 1.4 2007/03/29 17:59:35 dgp85 Exp $ */ #ifndef HAVE_MPEG_PARSER_H #define HAVE_MPEG_PARSER_H @@ -62,6 +62,9 @@ typedef struct mpeg_parser_s { /* parser initialization */ void mpeg_parser_init (mpeg_parser_t *parser); +/* parser disposal */ +void mpeg_parser_dispose (mpeg_parser_t *parser); + /* read a frame * return a pointer to the first byte of the next frame * or NULL if more bytes are needed -- cgit v1.2.3 From 71e00d9d010f9b6a9cfd531efb87f7757859833b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 29 Mar 2007 18:52:45 +0000 Subject: Reorder fields, use a bitmask to reduce the size, and change width and height to uint16_t (they are read as 12-bit values). CVS patchset: 8769 CVS date: 2007/03/29 18:52:45 --- src/libffmpeg/mpeg_parser.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/libffmpeg/mpeg_parser.h') diff --git a/src/libffmpeg/mpeg_parser.h b/src/libffmpeg/mpeg_parser.h index 0b93b21e0..859a0fcec 100644 --- a/src/libffmpeg/mpeg_parser.h +++ b/src/libffmpeg/mpeg_parser.h @@ -20,7 +20,7 @@ * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr) * based on libmpeg2 decoder. * - * $Id: mpeg_parser.h,v 1.4 2007/03/29 17:59:35 dgp85 Exp $ + * $Id: mpeg_parser.h,v 1.5 2007/03/29 18:52:45 dgp85 Exp $ */ #ifndef HAVE_MPEG_PARSER_H #define HAVE_MPEG_PARSER_H @@ -37,23 +37,26 @@ #define D_TYPE 4 typedef struct mpeg_parser_s { - uint32_t shift; - int is_sequence_needed; uint8_t *chunk_buffer; uint8_t *chunk_ptr; uint8_t *chunk_start; + uint32_t shift; int buffer_size; uint8_t code; uint8_t picture_coding_type; - int rate_code; + + uint8_t is_sequence_needed:1; + uint8_t is_mpeg1:1; /* public */ + uint8_t has_sequence:1; /* public */ + uint8_t in_slice:1; + + uint8_t rate_code:4; + int aspect_ratio_info; - int in_slice; /* public properties */ - int is_mpeg1; - int has_sequence; - int width; - int height; + uint16_t width; + uint16_t height; int frame_duration; double frame_aspect_ratio; -- cgit v1.2.3