Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
f0b769c1
Commit
f0b769c1
authored
9 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
lavc: add a packet side data type for VBV-like parameters
parent
e63e3797
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/APIchanges
+1
-0
1 addition, 0 deletions
doc/APIchanges
libavcodec/avcodec.h
+54
-0
54 additions, 0 deletions
libavcodec/avcodec.h
libavcodec/utils.c
+14
-0
14 additions, 0 deletions
libavcodec/utils.c
with
69 additions
and
0 deletions
doc/APIchanges
+
1
−
0
View file @
f0b769c1
...
...
@@ -16,6 +16,7 @@ API changes, most recent first:
2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h
xxxxxxx - Add av_packet_add_side_data().
xxxxxxx - Add AVCodecContext.coded_side_data.
xxxxxxx - Add AVCPBProperties API.
2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h
Deprecate rtp_callback without replacement, i.e. it won't be possible to
...
...
This diff is collapsed.
Click to expand it.
libavcodec/avcodec.h
+
54
−
0
View file @
f0b769c1
...
...
@@ -1036,6 +1036,44 @@ typedef struct AVPanScan{
int16_t
position
[
3
][
2
];
}
AVPanScan
;
/**
* This structure describes the bitrate properties of an encoded bitstream. It
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
* parameters for H.264/HEVC.
*/
typedef
struct
AVCPBProperties
{
/**
* Maximum bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int
max_bitrate
;
/**
* Minimum bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int
min_bitrate
;
/**
* Average bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int
avg_bitrate
;
/**
* The size of the buffer to which the ratecontrol is applied, in bits.
* Zero if unknown or unspecified.
*/
int
buffer_size
;
/**
* The delay between the time the packet this structure is associated with
* is received and the time when it should be decoded, in periods of a 27MHz
* clock.
*
* UINT64_MAX when unknown or unspecified.
*/
uint64_t
vbv_delay
;
}
AVCPBProperties
;
#if FF_API_QSCALE_TYPE
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
...
...
@@ -1137,6 +1175,11 @@ enum AVPacketSideDataType {
* e.g. no decoder available for codec.
*/
AV_PKT_DATA_FALLBACK_TRACK
,
/**
* This side data corresponds to the AVCPBProperties struct.
*/
AV_PKT_DATA_CPB_PROPERTIES
,
};
typedef
struct
AVPacketSideData
{
...
...
@@ -4630,6 +4673,17 @@ const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
*/
const
AVCodecDescriptor
*
avcodec_descriptor_get_by_name
(
const
char
*
name
);
/**
* Allocate a CPB properties structure and initialize its fields to default
* values.
*
* @param size if non-NULL, the size of the allocated struct will be written
* here. This is useful for embedding it in side data.
*
* @return the newly allocated struct or NULL on failure
*/
AVCPBProperties
*
av_cpb_properties_alloc
(
size_t
*
size
);
/**
* @}
*/
...
...
This diff is collapsed.
Click to expand it.
libavcodec/utils.c
+
14
−
0
View file @
f0b769c1
...
...
@@ -2369,3 +2369,17 @@ const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,
return
p
+
4
;
}
AVCPBProperties
*
av_cpb_properties_alloc
(
size_t
*
size
)
{
AVCPBProperties
*
props
=
av_mallocz
(
sizeof
(
AVCPBProperties
));
if
(
!
props
)
return
NULL
;
if
(
size
)
*
size
=
sizeof
(
*
props
);
props
->
vbv_delay
=
UINT64_MAX
;
return
props
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment