基于qt,msvc2017-64bits,ffmpeg.opengl的播放器
zhangmeng
2021-03-03 4a6d9312cc1c9d62d66c4def71246d9faae29edb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*!
 * COPYRIGHT (C) 2020 Emeric Grange - All Rights Reserved
 *
 * This file is part of MiniVideo.
 *
 * MiniVideo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MiniVideo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with MiniVideo.  If not, see <http://www.gnu.org/licenses/>.
 *
 * \file      ps_struct.h
 * \author    Emeric Grange <emeric.grange@gmail.com>
 * \date      2012
 */
 
#ifndef PARSER_MPEG_PS_STRUCT_H
#define PARSER_MPEG_PS_STRUCT_H
 
#include <stdint.h>
// minivideo headers
#include "minivideo/minivideo_typedef.h"
 
#include <cstdio>
 
/* ************************************************************************** */
 
typedef struct MpegPs_t
{
    bool run;                       //!< A convenient way to stop the parser from any sublevel
 
    unsigned mpeg_version;
 
    unsigned stat_packheader;
    unsigned stat_systemheader;
    unsigned stat_packet_psm;
    unsigned stat_packet_psd;
    unsigned stat_packet_private;
    unsigned stat_packet_audio;
    unsigned stat_packet_video;
    unsigned stat_packet_other;
 
    FILE *xml;                      //!< Temporary file used by the xmlMapper
 
} MpegPs_t;
 
/* ************************************************************************** */
 
/*!
 * \struct PackHeader_t
 * \brief 'Program Stream pack header' structure.
 *
 * From 'ISO/IEC 13818-1' specification:
 * Table 2-33 – Program Stream pack header.
 */
typedef struct PackHeader_t
{
    uint64_t system_clock_reference_base;
    uint16_t system_clock_reference_extension;
    uint32_t program_mux_rate;
    uint8_t pack_stuffing_length;
 
} PackHeader_t;
 
/*!
 * \struct SystemHeader_t
 * \brief 'Program Stream system header' structure.
 *
 * From 'ISO/IEC 13818-1' specification:
 * Table 2-34 – Program Stream system header.
 */
typedef struct SystemHeader_t
{
    uint32_t rate_bound;
    uint8_t audio_bound;
    uint8_t fixed_flag;
    uint8_t CSPS_flag;
    uint8_t system_audio_lock_flag;
    uint8_t system_video_lock_flag;
    uint8_t video_bound;
    uint8_t packet_rate_restriction_flag;
 
    // stack it?
    uint8_t stream_id;
    uint8_t PSTD_buffer_bound_scale;
    uint16_t PSTD_buffer_size_bound;
 
} SystemHeader_t;
 
/*!
 * \struct ProgramStreamMap_t
 * \brief 'Program Stream map' structure.
 *
 * From 'ISO/IEC 13818-1' specification:
 * Table 2-35 – Program Stream map.
 */
typedef struct ElementaryStreamMap_t {
    uint8_t stream_type;
    uint8_t elementary_stream_id;
    uint16_t elementary_stream_info_length;
    // descriptor
}ElementaryStreamMap_t;
 
typedef struct ProgramStreamMap_t
{
    uint8_t current_next_indicator;
    uint8_t program_stream_map_version;
    uint16_t program_stream_map_info_length;
        // descriptor
 
    uint16_t elementary_stream_map_length;
        // stack it?
    ElementaryStreamMap_t elementary_stream_map[8];
    uint8_t elementary_stream_map_size;
 
    uint32_t CRC_32;
 
} ProgramStreamMap_t;
 
/*!
 * \struct ProgramStreamDirectory_t
 * \brief 'Program Stream directory' structure.
 *
 * From 'ISO/IEC 13818-1' specification:
 * Table 2-36 – Program Stream directory packet.
 */
typedef struct ProgramStreamDirectory_t
{
    uint16_t number_of_access_units;
 
    uint64_t prev_directory_offset;
    uint64_t next_directory_offset;
 
        // stack it?
        uint8_t packet_stream_id;
        uint8_t PES_header_position_offset_sign;
        uint64_t PES_header_position_offset;
        uint16_t reference_offset;
        uint64_t PTS;
        uint16_t byes_to_read;
        uint8_t intra_coded_indicator;
        uint8_t coding_parameters_indicator;
 
} ProgramStreamDirectory_t;
 
/* ************************************************************************** */
#endif // PARSER_MPEG_PS_STRUCT_H