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
442c1320
Commit
442c1320
authored
13 years ago
by
Martin Storsjö
Browse files
Options
Downloads
Patches
Plain Diff
avpacket: Add a function for shrinking already allocated side data
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
5cd1337f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/APIchanges
+3
-0
3 additions, 0 deletions
doc/APIchanges
libavcodec/avcodec.h
+11
-0
11 additions, 0 deletions
libavcodec/avcodec.h
libavcodec/avpacket.c
+16
-0
16 additions, 0 deletions
libavcodec/avpacket.c
libavcodec/version.h
+1
-1
1 addition, 1 deletion
libavcodec/version.h
with
31 additions
and
1 deletion
doc/APIchanges
+
3
−
0
View file @
442c1320
...
@@ -12,6 +12,9 @@ libavutil: 2011-04-18
...
@@ -12,6 +12,9 @@ libavutil: 2011-04-18
API changes, most recent first:
API changes, most recent first:
2012-xx-xx - xxxxxxx - lavc 54.3.0 - avcodec.h
Add av_packet_shrink_side_data.
2012-xx-xx - xxxxxxx - lavf 54.2.0 - avformat.h
2012-xx-xx - xxxxxxx - lavf 54.2.0 - avformat.h
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
used for dealing with attached pictures/cover art.
used for dealing with attached pictures/cover art.
...
...
This diff is collapsed.
Click to expand it.
libavcodec/avcodec.h
+
11
−
0
View file @
442c1320
...
@@ -3078,6 +3078,17 @@ void av_free_packet(AVPacket *pkt);
...
@@ -3078,6 +3078,17 @@ void av_free_packet(AVPacket *pkt);
uint8_t
*
av_packet_new_side_data
(
AVPacket
*
pkt
,
enum
AVPacketSideDataType
type
,
uint8_t
*
av_packet_new_side_data
(
AVPacket
*
pkt
,
enum
AVPacketSideDataType
type
,
int
size
);
int
size
);
/**
* Shrink the already allocated side data buffer
*
* @param pkt packet
* @param type side information type
* @param size new side information size
* @return 0 on success, < 0 on failure
*/
int
av_packet_shrink_side_data
(
AVPacket
*
pkt
,
enum
AVPacketSideDataType
type
,
int
size
);
/**
/**
* Get side information from packet.
* Get side information from packet.
*
*
...
...
This diff is collapsed.
Click to expand it.
libavcodec/avpacket.c
+
16
−
0
View file @
442c1320
...
@@ -196,3 +196,19 @@ uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
...
@@ -196,3 +196,19 @@ uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
}
}
return
NULL
;
return
NULL
;
}
}
int
av_packet_shrink_side_data
(
AVPacket
*
pkt
,
enum
AVPacketSideDataType
type
,
int
size
)
{
int
i
;
for
(
i
=
0
;
i
<
pkt
->
side_data_elems
;
i
++
)
{
if
(
pkt
->
side_data
[
i
].
type
==
type
)
{
if
(
size
>
pkt
->
side_data
[
i
].
size
)
return
AVERROR
(
ENOMEM
);
pkt
->
side_data
[
i
].
size
=
size
;
return
0
;
}
}
return
AVERROR
(
ENOENT
);
}
This diff is collapsed.
Click to expand it.
libavcodec/version.h
+
1
−
1
View file @
442c1320
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR
2
#define LIBAVCODEC_VERSION_MINOR
3
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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