Bug 14603 -- this removes the remaining compilation warnings on my Mac OS X

build, and hopefully also in Linux. Ideally, do the same sort of thing for
the other "macro returning a constant string" cases.

--HG--
extra : convert_revision : svn%3Aeff31bef-be4a-0410-a8fe-e47997df2690/trunk%4070
issue20
tibs 2008-10-18 16:15:26 +00:00
rodzic 3ab74526ff
commit e1598da9c0
11 zmienionych plików z 149 dodań i 52 usunięć

Wyświetl plik

@ -96,6 +96,7 @@ SRCS = \
bitdata.c \
es.c \
fmtx.c \
h222.c \
h262.c \
audio.c \
l2audio.c \
@ -118,6 +119,7 @@ OBJS = \
es.o \
filter.o \
fmtx.o \
h222.o \
h262.o \
audio.o \
l2audio.o \
@ -288,9 +290,9 @@ $(BINDIR)/test_es_unit_list: $(OBJDIR)/test_es_unit_list.o $(LIB)
# Some header files depend upon others, so including one requires
# the others as well
ES_H = es_fns.h es_defns.h h222_defns.h
TS_H = ts_fns.h ts_defns.h h222_defns.h tswrite_fns.h tswrite_defns.h \
pidint_fns.h pidint_defns.h
ES_H = es_fns.h es_defns.h h222_fns.h h222_defns.h
TS_H = ts_fns.h ts_defns.h h222_fns.h h222_defns.h tswrite_fns.h \
tswrite_defns.h pidint_fns.h pidint_defns.h
ACCESSUNIT_H = accessunit_fns.h accessunit_defns.h $(NALUNIT_H)
NALUNIT_H = nalunit_fns.h nalunit_defns.h es_fns.h es_defns.h \
bitdata_fns.h bitdata_defns.h

Wyświetl plik

@ -94,6 +94,7 @@ LIB_OBJS = \
$(OBJDIR)\es.obj \
$(OBJDIR)\filter.obj \
$(OBJDIR)\fmtx.obj \
$(OBJDIR)\h222.obj \
$(OBJDIR)\h262.obj \
$(OBJDIR)\l2audio.obj \
$(OBJDIR)\misc.obj \

79
h222.c 100644
Wyświetl plik

@ -0,0 +1,79 @@
/*
* Datastructures and definitions useful for working with H.222 data,
* whether it be Transport Stream or Program Stream
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the MPEG TS, PS and ES tools.
*
* The Initial Developer of the Original Code is Amino Communications Ltd.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Amino Communications Ltd, Swavesey, Cambridge UK
*
* ***** END LICENSE BLOCK *****
*/
extern const char *h222_stream_type_str(unsigned s)
{
if ((0x1C < s) && (s < 0x7E))
return "H.220.0/13818-1 reserved";
else if ((0x80 <= s) && (s <= 0xFF))
return "User private";
else
switch (s)
{
case 0x00: return "Reserved";
case 0x01: return "11172-2 video (MPEG-1)";
case 0x02: return "H.262/13818-2 video (MPEG-2) or 11172-2 constrained video";
case 0x03: return "11172-3 audio (MPEG-1)";
case 0x04: return "13818-3 audio (MPEG-2)";
case 0x05: return "H.222.0/13818-1 private sections";
case 0x06: return "H.222.0/13818-1 PES private data (maybe Dolby/AC-3 in DVB)";
case 0x07: return "13522 MHEG";
case 0x08: return "H.222.0/13818-1 Annex A - DSM CC";
case 0x09: return "H.222.1";
case 0x0A: return "13818-6 type A";
case 0x0B: return "13818-6 type B";
case 0x0C: return "13818-6 type C";
case 0x0D: return "13818-6 type D";
case 0x0E: return "H.222.0/13818-1 auxiliary";
case 0x0F: return "13818-7 Audio with ADTS transport syntax";
case 0x10: return "14496-2 Visual (MPEG-4 part 2 video)";
case 0x11: return "14496-3 Audio with LATM transport syntax (14496-3/AMD 1)";
case 0x12: return "14496-1 SL-packetized or FlexMux stream in PES packets";
case 0x13: return "14496-1 SL-packetized or FlexMux stream in 14496 sections";
case 0x14: return "ISO/IEC 13818-6 Synchronized Download Protocol";
case 0x15: return "Metadata in PES packets";
case 0x16: return "Metadata in metadata_sections";
case 0x17: return "Metadata in 13818-6 Data Carousel";
case 0x18: return "Metadata in 13818-6 Object Carousel";
case 0x19: return "Metadata in 13818-6 Synchronized Download Protocol";
case 0x1A: return "13818-11 MPEG-2 IPMP stream";
case 0x1B: return "H.264/14496-10 video (MPEG-4/AVC)";
case 0x42: return "AVS Video";
case 0x7F: return "IPMP stream";
case 0x81: return "User private (commonly Dolby/AC-3 in ATSC)";
default: return "Unrecognised";
}
}
// Local Variables:
// tab-width: 8
// indent-tabs-mode: nil
// c-basic-offset: 2
// End:
// vim: set tabstop=8 shiftwidth=2 expandtab:

Wyświetl plik

@ -30,6 +30,12 @@
#ifndef _h222_defns
#define _h222_defns
// Include our function definition(s)
// -- this is actually just the function for returning a string
// representing a stream type (according to the following table),
// which *used* to be a macro, defined in this header file.
#include "h222_fns.h"
// ------------------------------------------------------------
// H.222.0 Table 2-29: Stream type assignments, as amended by
// H.222.0 (2000) Amendment 3
@ -75,42 +81,6 @@
// 80-FF User Private
// 81 Traditionally ATSC Dolby (AC-3)
#define H222_STREAM_TYPE_STR(s) \
((s)==0x00?"Reserved": \
(s)==0x01?"11172-2 video (MPEG-1)": \
(s)==0x02?"H.262/13818-2 video (MPEG-2) or 11172-2 constrained video": \
(s)==0x03?"11172-3 audio (MPEG-1)": \
(s)==0x04?"13818-3 audio (MPEG-2)": \
(s)==0x05?"H.222.0/13818-1 private sections": \
(s)==0x06?"H.222.0/13818-1 PES private data (maybe Dolby/AC-3 in DVB)": \
(s)==0x07?"13522 MHEG": \
(s)==0x08?"H.222.0/13818-1 Annex A - DSM CC": \
(s)==0x09?"H.222.1": \
(s)==0x0A?"13818-6 type A": \
(s)==0x0B?"13818-6 type B": \
(s)==0x0C?"13818-6 type C": \
(s)==0x0D?"13818-6 type D": \
(s)==0x0E?"H.222.0/13818-1 auxiliary": \
(s)==0x0F?"13818-7 Audio with ADTS transport syntax": \
(s)==0x10?"14496-2 Visual (MPEG-4 part 2 video)": \
(s)==0x11?"14496-3 Audio with LATM transport syntax (14496-3/AMD 1)": \
(s)==0x12?"14496-1 SL-packetized or FlexMux stream in PES packets": \
(s)==0x13?"14496-1 SL-packetized or FlexMux stream in 14496 sections": \
(s)==0x14?"ISO/IEC 13818-6 Synchronized Download Protocol": \
(s)==0x15?"Metadata in PES packets": \
(s)==0x16?"Metadata in metadata_sections": \
(s)==0x17?"Metadata in 13818-6 Data Carousel": \
(s)==0x18?"Metadata in 13818-6 Object Carousel": \
(s)==0x19?"Metadata in 13818-6 Synchronized Download Protocol": \
(s)==0x1A?"13818-11 MPEG-2 IPMP stream": \
(s)==0x1B?"H.264/14496-10 video (MPEG-4/AVC)": \
(s)==0x42?"AVS Video": \
(0x1C < (s)) && ((s) < 0x7E)?"H.220.0/13818-1 reserved": \
(s)==0x7F?"IPMP stream": \
(s)==0x81?"User private (commonly Dolby/AC-3 in ATSC)": \
(0x80 <= (s)) && ((s) <= 0xFF)?"User private": \
"Unrecognised")
#define MPEG1_VIDEO_STREAM_TYPE 0x01
#define MPEG2_VIDEO_STREAM_TYPE 0x02 // H.262
#define AVC_VIDEO_STREAM_TYPE 0x1B // MPEG-4 part10 - H.264

45
h222_fns.h 100644
Wyświetl plik

@ -0,0 +1,45 @@
/*
* Prototypes for functions relating to H.222 data, whether TS or PS
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the MPEG TS, PS and ES tools.
*
* The Initial Developer of the Original Code is Amino Communications Ltd.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Amino Communications Ltd, Swavesey, Cambridge UK
*
* ***** END LICENSE BLOCK *****
*/
#ifndef _h222_fns
#define _h222_fns
// We don't include our corresponding header file, since there's
// nothing we depend on from it. However, not that *it* includes
// us, mainly for historical reasons.
extern const char *h222_stream_type_str(unsigned s);
#endif _h222_fns
// Local Variables:
// tab-width: 8
// indent-tabs-mode: nil
// c-basic-offset: 2
// End:
// vim: set tabstop=8 shiftwidth=2 expandtab:

4
pes.c
Wyświetl plik

@ -3818,11 +3818,11 @@ extern int write_program_data(PES_reader_p reader,
reader->output_pmt_pid,reader->output_pmt_pid,
pcr_pid,pcr_pid,
reader->output_video_pid,reader->output_video_pid,
prog_type[0],H222_STREAM_TYPE_STR(prog_type[0]));
prog_type[0],h222_stream_type_str(prog_type[0]));
if (num_progs == 2)
printf(" audio %x (%d) type %02x (%s)\n",
reader->output_audio_pid,reader->output_audio_pid,
prog_type[1],H222_STREAM_TYPE_STR(prog_type[1]));
prog_type[1],h222_stream_type_str(prog_type[1]));
}
#endif

Wyświetl plik

@ -327,7 +327,7 @@ extern void report_stream_list(pidint_list_p list,
if (prefix!=NULL) printf(prefix);
printf(" PID %04x (%d) -> Stream type %3d (%s)\n",
list->pid[ii],list->pid[ii],list->number[ii],
H222_STREAM_TYPE_STR(list->number[ii]));
h222_stream_type_str(list->number[ii]));
}
}
}
@ -752,7 +752,7 @@ extern void report_pmt(FILE *stream,
pmt->streams[ii].elementary_PID,
pmt->streams[ii].stream_type,
pmt->streams[ii].stream_type,
H222_STREAM_TYPE_STR(pmt->streams[ii].stream_type));
h222_stream_type_str(pmt->streams[ii].stream_type));
if (pmt->streams[ii].ES_info_length > 0)
{
if (prefix!=NULL) fprintf(stream,prefix);

4
ps.c
Wyświetl plik

@ -1216,7 +1216,7 @@ static int write_video(TS_writer_p output,
printf("Video: stream %d, PID 0x%03x, stream type 0x%02x\n"
" %s\n",
stream_id & 0x0F,prog_data->video_pid,prog_data->video_type,
H222_STREAM_TYPE_STR(prog_data->video_type));
h222_stream_type_str(prog_data->video_type));
err = add_stream_to_pmt(prog_data->pmt,prog_data->video_pid,
prog_data->video_type,0,NULL);
@ -1529,7 +1529,7 @@ static int write_audio(TS_writer_p output,
{
printf("Audio: stream %d, PID 0x%03x, stream type 0x%02x = %s\n",
stream_id & 0x1F,prog_data->audio_pid,audio_stream_type,
H222_STREAM_TYPE_STR(audio_stream_type));
h222_stream_type_str(audio_stream_type));
}
}

Wyświetl plik

@ -419,7 +419,7 @@ int main(int argc, char **argv)
{
if (!quiet)
printf("Reading input as %s (0x%02x)\n",
H222_STREAM_TYPE_STR(video_type),video_type);
h222_stream_type_str(video_type),video_type);
}
else
{
@ -427,7 +427,7 @@ int main(int argc, char **argv)
if (err) return 1;
if (!quiet)
printf("Video appears to be %s (0x%02x)\n",
H222_STREAM_TYPE_STR(video_type),video_type);
h222_stream_type_str(video_type),video_type);
}
if (!quiet)

4
ts.c
Wyświetl plik

@ -2698,7 +2698,7 @@ extern int extract_pmt(int verbose,
if (verbose)
{
printf(" PID %04x -> Stream %02x %s\n",pid,stream_type,
H222_STREAM_TYPE_STR(stream_type));
h222_stream_type_str(stream_type));
if (ES_info_length > 0)
print_descriptors(stdout," ",NULL,&stream_data[5],ES_info_length);
}
@ -2920,7 +2920,7 @@ extern int extract_stream_list_from_pmt(int verbose,
{
#define SARRAYSIZE 40
char buf[SARRAYSIZE];
snprintf(buf,SARRAYSIZE,"(%s)",H222_STREAM_TYPE_STR(stream_type));
snprintf(buf,SARRAYSIZE,"(%s)",h222_stream_type_str(stream_type));
// On Windows, snprintf does not guarantee to write a terminating NULL
buf[SARRAYSIZE-1] = '\0';
printf(" Stream %02x %-40s -> PID %04x\n",stream_type,buf,pid);

Wyświetl plik

@ -211,7 +211,7 @@ static int report_buffering_stats(TS_reader_p tsreader,
printf("Looking at PCR PID %04x (%d)\n",pcr_pid,pcr_pid);
for (ii=0; ii<num_streams; ii++)
printf(" Stream %d: PID %04x (%d), %s\n",ii,stats[ii].pid,stats[ii].pid,
H222_STREAM_TYPE_STR(stats[ii].stream_type));
h222_stream_type_str(stats[ii].stream_type));
// Now do the actual work...
start_count = count = pmt_at;
@ -524,7 +524,7 @@ static int report_buffering_stats(TS_reader_p tsreader,
for (ii = 0; ii < num_streams; ii++)
{
printf("\nStream %d: PID %04x (%d), %s\n",ii,stats[ii].pid,stats[ii].pid,
H222_STREAM_TYPE_STR(stats[ii].stream_type));
h222_stream_type_str(stats[ii].stream_type));
if (stats[ii].pcr_pts_diff.num > 0)
{
printf(" PCR/%s:\n Minimum difference was %6s at DTS %8s, TS packet at " OFFSET_T_FORMAT_8 "\n",
@ -673,7 +673,7 @@ static int report_ts(TS_reader_p tsreader,
return 1;
}
printf(" stream type %02x (%s)\n",
stream->stream_type,H222_STREAM_TYPE_STR(stream->stream_type));
stream->stream_type,h222_stream_type_str(stream->stream_type));
}
else
printf(" stream type not identified\n");