Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
17a5556d
Commit
17a5556d
authored
Apr 30, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegts: add compute_pcr option.
Deprecate the corresponding AVFormatParameters field.
parent
5dc82144
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
avformat.h
libavformat/avformat.h
+4
-3
mpegts.c
libavformat/mpegts.c
+21
-1
version.h
libavformat/version.h
+3
-0
No files found.
libavformat/avformat.h
View file @
17a5556d
...
@@ -236,9 +236,10 @@ typedef struct AVFormatParameters {
...
@@ -236,9 +236,10 @@ typedef struct AVFormatParameters {
int
channel
;
/**< Used to select DV channel. */
int
channel
;
/**< Used to select DV channel. */
const
char
*
standard
;
/**< TV standard, NTSC, PAL, SECAM */
const
char
*
standard
;
/**< TV standard, NTSC, PAL, SECAM */
unsigned
int
mpeg2ts_raw
:
1
;
/**< Force raw MPEG-2 transport stream output, if possible. */
unsigned
int
mpeg2ts_raw
:
1
;
/**< Force raw MPEG-2 transport stream output, if possible. */
unsigned
int
mpeg2ts_compute_pcr
:
1
;
/**< Compute exact PCR for each transport
#if FF_API_FORMAT_PARAMETERS
stream packet (only meaningful if
/**< deprecated, use mpegtsraw demuxer-specific options instead */
mpeg2ts_raw is TRUE). */
attribute_deprecated
unsigned
int
mpeg2ts_compute_pcr
:
1
;
#endif
unsigned
int
initial_pause
:
1
;
/**< Do not begin to play the stream
unsigned
int
initial_pause
:
1
;
/**< Do not begin to play the stream
immediately (RTSP only). */
immediately (RTSP only). */
unsigned
int
prealloced_context
:
1
;
unsigned
int
prealloced_context
:
1
;
...
...
libavformat/mpegts.c
View file @
17a5556d
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
#include "libavutil/crc.h"
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
#include "avformat.h"
#include "mpegts.h"
#include "mpegts.h"
...
@@ -86,6 +88,7 @@ struct Program {
...
@@ -86,6 +88,7 @@ struct Program {
};
};
struct
MpegTSContext
{
struct
MpegTSContext
{
const
AVClass
*
class
;
/* user data */
/* user data */
AVFormatContext
*
stream
;
AVFormatContext
*
stream
;
/** raw packet size, including FEC if present */
/** raw packet size, including FEC if present */
...
@@ -122,6 +125,19 @@ struct MpegTSContext {
...
@@ -122,6 +125,19 @@ struct MpegTSContext {
MpegTSFilter
*
pids
[
NB_PID_MAX
];
MpegTSFilter
*
pids
[
NB_PID_MAX
];
};
};
static
const
AVOption
options
[]
=
{
{
"compute_pcr"
,
"Compute exact PCR for each transport stream packet."
,
offsetof
(
MpegTSContext
,
mpeg2ts_compute_pcr
),
FF_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
1
,
AV_OPT_FLAG_DECODING_PARAM
},
{
NULL
},
};
static
const
AVClass
mpegtsraw_class
=
{
.
class_name
=
"mpegtsraw demuxer"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
/* TS stream handling */
/* TS stream handling */
enum
MpegTSState
{
enum
MpegTSState
{
...
@@ -1455,7 +1471,10 @@ static int mpegts_read_header(AVFormatContext *s,
...
@@ -1455,7 +1471,10 @@ static int mpegts_read_header(AVFormatContext *s,
int64_t
pos
;
int64_t
pos
;
if
(
ap
)
{
if
(
ap
)
{
#if FF_API_FORMAT_PARAMETERS
if
(
ap
->
mpeg2ts_compute_pcr
)
ts
->
mpeg2ts_compute_pcr
=
ap
->
mpeg2ts_compute_pcr
;
ts
->
mpeg2ts_compute_pcr
=
ap
->
mpeg2ts_compute_pcr
;
#endif
if
(
ap
->
mpeg2ts_raw
){
if
(
ap
->
mpeg2ts_raw
){
av_log
(
s
,
AV_LOG_ERROR
,
"use mpegtsraw_demuxer!
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"use mpegtsraw_demuxer!
\n
"
);
return
-
1
;
return
-
1
;
...
@@ -1878,4 +1897,5 @@ AVInputFormat ff_mpegtsraw_demuxer = {
...
@@ -1878,4 +1897,5 @@ AVInputFormat ff_mpegtsraw_demuxer = {
#ifdef USE_SYNCPOINT_SEARCH
#ifdef USE_SYNCPOINT_SEARCH
.
read_seek2
=
read_seek2
,
.
read_seek2
=
read_seek2
,
#endif
#endif
.
priv_class
=
&
mpegtsraw_class
,
};
};
libavformat/version.h
View file @
17a5556d
...
@@ -68,5 +68,8 @@
...
@@ -68,5 +68,8 @@
#ifndef FF_API_SDP_CREATE
#ifndef FF_API_SDP_CREATE
#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54)
#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#endif
#ifndef FF_API_FORMAT_PARAMETERS
#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#endif
/* AVFORMAT_VERSION_H */
#endif
/* AVFORMAT_VERSION_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment