summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/mpeg3demux.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/mpeg3demux.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/mpeg3demux.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/mpeg3demux.h b/core/multimedia/opieplayer/libmpeg3/mpeg3demux.h
new file mode 100644
index 0000000..9dfd182
--- a/dev/null
+++ b/core/multimedia/opieplayer/libmpeg3/mpeg3demux.h
@@ -0,0 +1,118 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef MPEG3DEMUX_H
21#define MPEG3DEMUX_H
22
23#include "mpeg3title.h"
24#include <stdio.h>
25
26typedef struct
27{
28 struct mpeg3_rec* file;
29/* Data consisting of the multiplexed packet */
30 unsigned char *raw_data;
31 long raw_offset;
32 int raw_size;
33 long packet_size;
34/* Only one is on depending on which track owns the demultiplexer. */
35 int do_audio;
36 int do_video;
37/* Data consisting of the elementary stream */
38 unsigned char *data_buffer;
39 long data_size;
40 long data_position;
41 long data_allocated;
42/* Remember when the file descriptor is at the beginning of the packet just read. */
43 int reverse;
44/* Set to 1 when eof or attempt to read before beginning */
45 int error_flag;
46/* Temp variables for returning */
47 unsigned char next_char;
48/* Correction factor for time discontinuity */
49 double time_offset;
50 int generating_timecode;
51
52/* Titles */
53 mpeg3_title_t *titles[MPEG3_MAX_STREAMS];
54 int total_titles;
55 int current_title;
56
57/* Tables of every stream ID encountered */
58 int astream_table[MPEG3_MAX_STREAMS]; /* macro of audio format if audio */
59 int vstream_table[MPEG3_MAX_STREAMS]; /* 1 if video */
60
61/* Programs */
62 int total_programs;
63 int current_program;
64
65/* Timecode in the current title */
66 int current_timecode;
67
68/* Byte position in the current title */
69 long current_byte;
70
71 int transport_error_indicator;
72 int payload_unit_start_indicator;
73 int pid;
74 int transport_scrambling_control;
75 int adaptation_field_control;
76 int continuity_counter;
77 int is_padding;
78 int pid_table[MPEG3_PIDMAX];
79 int continuity_counters[MPEG3_PIDMAX];
80 int total_pids;
81 int adaptation_fields;
82 double time; /* Time in seconds */
83 int audio_pid;
84 int video_pid;
85 int astream; /* Video stream ID being decoded. -1 = select first ID in stream */
86 int vstream; /* Audio stream ID being decoded. -1 = select first ID in stream */
87 int aformat; /* format of the audio derived from multiplexing codes */
88 long program_association_tables;
89 int table_id;
90 int section_length;
91 int transport_stream_id;
92 long pes_packets;
93 double pes_audio_time; /* Presentation Time stamps */
94 double pes_video_time; /* Presentation Time stamps */
95} mpeg3_demuxer_t;
96
97/* ========================================================================= */
98/* Entry points */
99/* ========================================================================= */
100
101#define mpeg3demux_error(demuxer) (((mpeg3_demuxer_t *)(demuxer))->error_flag)
102
103#define mpeg3demux_time_offset(demuxer) (((mpeg3_demuxer_t *)(demuxer))->time_offset)
104
105#define mpeg3demux_current_time(demuxer) (((mpeg3_demuxer_t *)(demuxer))->time + ((mpeg3_demuxer_t *)(demuxer))->time_offset)
106
107#define mpeg3demux_read_char(demuxer) \
108 ((((mpeg3_demuxer_t *)(demuxer))->data_position < ((mpeg3_demuxer_t *)(demuxer))->data_size) ? \
109 ((mpeg3_demuxer_t *)(demuxer))->data_buffer[((mpeg3_demuxer_t *)(demuxer))->data_position++] : \
110 mpeg3demux_read_char_packet(demuxer))
111
112#define mpeg3demux_read_prev_char(demuxer) \
113 ((((mpeg3_demuxer_t *)(demuxer))->data_position != 0) ? \
114 ((mpeg3_demuxer_t *)(demuxer))->data_buffer[((mpeg3_demuxer_t *)(demuxer))->data_position--] : \
115 mpeg3demux_read_prev_char_packet(demuxer))
116
117
118#endif