[MPlayer-cvslog] r34247 - in trunk/libmpdemux: mpeg_hdr.c mpeg_hdr.h
reimar
subversion at mplayerhq.hu
Mon Oct 24 18:20:00 CEST 2011
Author: reimar
Date: Mon Oct 24 18:20:00 2011
New Revision: 34247
Log:
Mark pointer arguments as const where possible.
Modified:
trunk/libmpdemux/mpeg_hdr.c
trunk/libmpdemux/mpeg_hdr.h
Modified: trunk/libmpdemux/mpeg_hdr.c
==============================================================================
--- trunk/libmpdemux/mpeg_hdr.c Mon Oct 24 18:15:02 2011 (r34246)
+++ trunk/libmpdemux/mpeg_hdr.c Mon Oct 24 18:20:00 2011 (r34247)
@@ -70,7 +70,7 @@ int mp_header_process_sequence_header (m
}
static int header_process_sequence_extension (mp_mpeg_header_t * picture,
- unsigned char * buffer)
+ const unsigned char * buffer)
{
/* check chroma format, size extensions, marker bit */
@@ -87,7 +87,7 @@ static int header_process_sequence_exten
return 0;
}
-static int header_process_picture_coding_extension (mp_mpeg_header_t * picture, unsigned char * buffer)
+static int header_process_picture_coding_extension (mp_mpeg_header_t * picture, const unsigned char * buffer)
{
picture->picture_structure = buffer[2] & 3;
picture->top_field_first = buffer[3] >> 7;
@@ -113,7 +113,7 @@ static int header_process_picture_coding
return 0;
}
-int mp_header_process_extension (mp_mpeg_header_t * picture, unsigned char * buffer)
+int mp_header_process_extension (mp_mpeg_header_t * picture, const unsigned char * buffer)
{
switch (buffer[0] & 0xf0) {
case 0x10: /* sequence extension */
@@ -157,7 +157,7 @@ float mpeg12_aspect_info(mp_mpeg_header_
}
//MPEG4 HEADERS
-unsigned char mp_getbits(unsigned char *buffer, unsigned int from, unsigned char len)
+unsigned char mp_getbits(const unsigned char *buffer, unsigned int from, unsigned char len)
{
unsigned int n;
unsigned char m, u, l, y;
@@ -178,7 +178,7 @@ unsigned char mp_getbits(unsigned char *
return y;
}
-static inline unsigned int mp_getbits16(unsigned char *buffer, unsigned int from, unsigned char len)
+static inline unsigned int mp_getbits16(const unsigned char *buffer, unsigned int from, unsigned char len)
{
if(len > 8)
return (mp_getbits(buffer, from, len - 8) << 8) | mp_getbits(buffer, from + len - 8, 8);
@@ -189,7 +189,7 @@ static inline unsigned int mp_getbits16(
#define getbits mp_getbits
#define getbits16 mp_getbits16
-static int read_timeinc(mp_mpeg_header_t * picture, unsigned char * buffer, int n)
+static int read_timeinc(mp_mpeg_header_t * picture, const unsigned char * buffer, int n)
{
if(picture->timeinc_bits > 8) {
picture->timeinc_unit = getbits(buffer, n, picture->timeinc_bits - 8) << 8;
@@ -204,7 +204,7 @@ static int read_timeinc(mp_mpeg_header_t
return n;
}
-int mp4_header_process_vol(mp_mpeg_header_t * picture, unsigned char * buffer)
+int mp4_header_process_vol(mp_mpeg_header_t * picture, const unsigned char * buffer)
{
unsigned int n, aspect=0, aspectw=0, aspecth=0, x=1, v;
@@ -268,7 +268,7 @@ int mp4_header_process_vol(mp_mpeg_heade
return 0;
}
-void mp4_header_process_vop(mp_mpeg_header_t * picture, unsigned char * buffer)
+void mp4_header_process_vop(mp_mpeg_header_t * picture, const unsigned char * buffer)
{
int n;
n = 0;
Modified: trunk/libmpdemux/mpeg_hdr.h
==============================================================================
--- trunk/libmpdemux/mpeg_hdr.h Mon Oct 24 18:15:02 2011 (r34246)
+++ trunk/libmpdemux/mpeg_hdr.h Mon Oct 24 18:20:00 2011 (r34247)
@@ -43,13 +43,13 @@ typedef struct {
} mp_mpeg_header_t;
int mp_header_process_sequence_header (mp_mpeg_header_t * picture, const unsigned char * buffer);
-int mp_header_process_extension (mp_mpeg_header_t * picture, unsigned char * buffer);
+int mp_header_process_extension (mp_mpeg_header_t * picture, const unsigned char * buffer);
float mpeg12_aspect_info(mp_mpeg_header_t *picture);
-int mp4_header_process_vol(mp_mpeg_header_t * picture, unsigned char * buffer);
-void mp4_header_process_vop(mp_mpeg_header_t * picture, unsigned char * buffer);
+int mp4_header_process_vol(mp_mpeg_header_t * picture, const unsigned char * buffer);
+void mp4_header_process_vop(mp_mpeg_header_t * picture, const unsigned char * buffer);
int h264_parse_sps(mp_mpeg_header_t * picture, const unsigned char * buf, int len);
int mp_vc1_decode_sequence_header(mp_mpeg_header_t * picture, const unsigned char * buf, int len);
-unsigned char mp_getbits(unsigned char *buffer, unsigned int from, unsigned char len);
+unsigned char mp_getbits(const unsigned char *buffer, unsigned int from, unsigned char len);
#endif /* MPLAYER_MPEG_HDR_H */
More information about the MPlayer-cvslog
mailing list