Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
da6506c6
Commit
da6506c6
authored
Oct 27, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: move AVCodecContext.pkt to AVCodecInternal
It's a private field, not meant to be accessed from outside lavc.
parent
38ecc370
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
11 deletions
+20
-11
avcodec.h
libavcodec/avcodec.h
+4
-5
internal.h
libavcodec/internal.h
+6
-0
pthread_frame.c
libavcodec/pthread_frame.c
+1
-1
rawdec.c
libavcodec/rawdec.c
+2
-1
utils.c
libavcodec/utils.c
+4
-4
version.h
libavcodec/version.h
+3
-0
No files found.
libavcodec/avcodec.h
View file @
da6506c6
...
...
@@ -2672,14 +2672,13 @@ typedef struct AVCodecContext {
*/
int
error_rate
;
#if FF_API_CODEC_PKT
/**
* Current packet as passed into the decoder, to avoid having
* to pass the packet into every function. Currently only valid
* inside lavc and get/release_buffer callbacks.
* - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
* - encoding: unused
* @deprecated this field is not supposed to be accessed from outside lavc
*/
attribute_deprecated
AVPacket
*
pkt
;
#endif
/**
* VBV delay coded in the last frame (in periods of a 27 MHz clock).
...
...
libavcodec/internal.h
View file @
da6506c6
...
...
@@ -88,6 +88,12 @@ typedef struct AVCodecInternal {
FramePool
*
pool
;
void
*
thread_ctx
;
/**
* Current packet as passed into the decoder, to avoid having to pass the
* packet into every function.
*/
AVPacket
*
pkt
;
}
AVCodecInternal
;
struct
AVCodecDefault
{
...
...
libavcodec/pthread_frame.c
View file @
da6506c6
...
...
@@ -608,7 +608,6 @@ int ff_frame_thread_init(AVCodecContext *avctx)
}
*
copy
=
*
src
;
copy
->
pkt
=
&
p
->
avpkt
;
copy
->
internal
=
av_malloc
(
sizeof
(
AVCodecInternal
));
if
(
!
copy
->
internal
)
{
...
...
@@ -617,6 +616,7 @@ int ff_frame_thread_init(AVCodecContext *avctx)
}
*
copy
->
internal
=
*
src
->
internal
;
copy
->
internal
->
thread_ctx
=
p
;
copy
->
internal
->
pkt
=
&
p
->
avpkt
;
if
(
!
i
)
{
src
=
copy
;
...
...
libavcodec/rawdec.c
View file @
da6506c6
...
...
@@ -25,6 +25,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "raw.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
...
...
@@ -150,7 +151,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
frame
->
key_frame
=
1
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
frame
->
pkt_pts
=
avctx
->
pkt
->
pts
;
frame
->
pkt_pts
=
avctx
->
internal
->
pkt
->
pts
;
if
(
buf_size
<
context
->
frame_size
-
(
avctx
->
pix_fmt
==
AV_PIX_FMT_PAL8
?
AVPALETTE_SIZE
:
0
))
...
...
libavcodec/utils.c
View file @
da6506c6
...
...
@@ -613,7 +613,7 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
default
:
return
AVERROR
(
EINVAL
);
}
frame
->
pkt_pts
=
avctx
->
pkt
?
avctx
->
pkt
->
pts
:
AV_NOPTS_VALUE
;
frame
->
pkt_pts
=
avctx
->
internal
->
pkt
?
avctx
->
internal
->
pkt
->
pts
:
AV_NOPTS_VALUE
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
#if FF_API_GET_BUFFER
...
...
@@ -1402,7 +1402,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
if
((
avctx
->
coded_width
||
avctx
->
coded_height
)
&&
av_image_check_size
(
avctx
->
coded_width
,
avctx
->
coded_height
,
0
,
avctx
))
return
-
1
;
avctx
->
pkt
=
avpkt
;
avctx
->
internal
->
pkt
=
avpkt
;
ret
=
apply_param_change
(
avctx
,
avpkt
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error applying parameter changes.
\n
"
);
...
...
@@ -1467,7 +1467,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
*
got_frame_ptr
=
0
;
avctx
->
pkt
=
avpkt
;
avctx
->
internal
->
pkt
=
avpkt
;
if
(
!
avpkt
->
data
&&
avpkt
->
size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid packet: NULL data, size != 0
\n
"
);
...
...
@@ -1522,7 +1522,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
{
int
ret
;
avctx
->
pkt
=
avpkt
;
avctx
->
internal
->
pkt
=
avpkt
;
*
got_sub_ptr
=
0
;
ret
=
avctx
->
codec
->
decode
(
avctx
,
sub
,
got_sub_ptr
,
avpkt
);
if
(
*
got_sub_ptr
)
...
...
libavcodec/version.h
View file @
da6506c6
...
...
@@ -91,5 +91,8 @@
#ifndef FF_API_THREAD_OPAQUE
#define FF_API_THREAD_OPAQUE (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_CODEC_PKT
#define FF_API_CODEC_PKT (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#endif
/* AVCODEC_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