Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b1ca5634
Commit
b1ca5634
authored
Nov 16, 2011
by
Clément Bœsch
Committed by
Clément Bœsch
Nov 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12: raise timecode to codec context.
parent
2cf4bd77
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
avcodec.h
libavcodec/avcodec.h
+3
-3
mpeg12.c
libavcodec/mpeg12.c
+9
-11
mpeg12enc.c
libavcodec/mpeg12enc.c
+2
-0
options.c
libavcodec/options.c
+1
-0
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/avcodec.h
View file @
b1ca5634
...
@@ -2710,9 +2710,9 @@ typedef struct AVCodecContext {
...
@@ -2710,9 +2710,9 @@ typedef struct AVCodecContext {
#endif
#endif
/**
/**
* GOP timecode frame start number
, in non drop frame format
* GOP timecode frame start number
* - encoding: Set by user
.
* - encoding: Set by user
, in non drop frame format
* - decoding:
unused
* - decoding:
Set by libavcodec (timecode in the 25 bits format, -1 if unset)
*/
*/
int64_t
timecode_frame_start
;
int64_t
timecode_frame_start
;
...
...
libavcodec/mpeg12.c
View file @
b1ca5634
...
@@ -2141,20 +2141,12 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
...
@@ -2141,20 +2141,12 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
{
{
Mpeg1Context
*
s1
=
avctx
->
priv_data
;
Mpeg1Context
*
s1
=
avctx
->
priv_data
;
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
int
drop_frame_flag
;
int
time_code_hours
,
time_code_minutes
;
int
time_code_seconds
,
time_code_pictures
;
int
broken_link
;
int
broken_link
;
int64_t
tc
;
init_get_bits
(
&
s
->
gb
,
buf
,
buf_size
*
8
);
init_get_bits
(
&
s
->
gb
,
buf
,
buf_size
*
8
);
drop_frame_flag
=
get_bits
(
&
s
->
gb
,
1
);
tc
=
avctx
->
timecode_frame_start
=
get_bits
(
&
s
->
gb
,
25
);
time_code_hours
=
get_bits
(
&
s
->
gb
,
5
);
time_code_minutes
=
get_bits
(
&
s
->
gb
,
6
);
skip_bits1
(
&
s
->
gb
);
// marker bit
time_code_seconds
=
get_bits
(
&
s
->
gb
,
6
);
time_code_pictures
=
get_bits
(
&
s
->
gb
,
6
);
s
->
closed_gop
=
get_bits1
(
&
s
->
gb
);
s
->
closed_gop
=
get_bits1
(
&
s
->
gb
);
/*broken_link indicate that after editing the
/*broken_link indicate that after editing the
...
@@ -2162,11 +2154,17 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
...
@@ -2162,11 +2154,17 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
are missing (open gop)*/
are missing (open gop)*/
broken_link
=
get_bits1
(
&
s
->
gb
);
broken_link
=
get_bits1
(
&
s
->
gb
);
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
int
time_code_hours
=
tc
>>
19
&
0x1f
;
int
time_code_minutes
=
tc
>>
13
&
0x3f
;
int
time_code_seconds
=
tc
>>
6
&
0x3f
;
int
drop_frame_flag
=
tc
&
1
<<
24
;
int
time_code_pictures
=
tc
&
0x3f
;
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"GOP (%02d:%02d:%02d%c%02d) closed_gop=%d broken_link=%d
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"GOP (%02d:%02d:%02d%c%02d) closed_gop=%d broken_link=%d
\n
"
,
time_code_hours
,
time_code_minutes
,
time_code_seconds
,
time_code_hours
,
time_code_minutes
,
time_code_seconds
,
drop_frame_flag
?
';'
:
':'
,
drop_frame_flag
?
';'
:
':'
,
time_code_pictures
,
s
->
closed_gop
,
broken_link
);
time_code_pictures
,
s
->
closed_gop
,
broken_link
);
}
}
}
/**
/**
* Find the end of the current frame in the bitstream.
* Find the end of the current frame in the bitstream.
...
...
libavcodec/mpeg12enc.c
View file @
b1ca5634
...
@@ -185,6 +185,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
...
@@ -185,6 +185,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
if
(
ff_init_smtpe_timecode
(
s
,
&
s
->
tc
)
<
0
)
if
(
ff_init_smtpe_timecode
(
s
,
&
s
->
tc
)
<
0
)
return
-
1
;
return
-
1
;
s
->
avctx
->
timecode_frame_start
=
s
->
tc
.
start
;
s
->
avctx
->
timecode_frame_start
=
s
->
tc
.
start
;
}
else
{
s
->
avctx
->
timecode_frame_start
=
0
;
// default is -1
}
}
return
0
;
return
0
;
}
}
...
...
libavcodec/options.c
View file @
b1ca5634
...
@@ -578,6 +578,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
...
@@ -578,6 +578,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
pix_fmt
=
PIX_FMT_NONE
;
s
->
pix_fmt
=
PIX_FMT_NONE
;
s
->
sample_fmt
=
AV_SAMPLE_FMT_NONE
;
s
->
sample_fmt
=
AV_SAMPLE_FMT_NONE
;
s
->
timecode_frame_start
=
-
1
;
s
->
reget_buffer
=
avcodec_default_reget_buffer
;
s
->
reget_buffer
=
avcodec_default_reget_buffer
;
s
->
reordered_opaque
=
AV_NOPTS_VALUE
;
s
->
reordered_opaque
=
AV_NOPTS_VALUE
;
...
...
libavcodec/version.h
View file @
b1ca5634
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 3
8
#define LIBAVCODEC_VERSION_MINOR 3
9
#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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