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
aaf937ee
Commit
aaf937ee
authored
Jul 27, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hap: Add utility functions file
Missing from the push of
3ee21785
.
parent
3ee21785
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
hap.c
libavcodec/hap.c
+55
-0
No files found.
libavcodec/hap.c
0 → 100644
View file @
aaf937ee
/*
* Vidvox Hap utility functions
* Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Hap utilities
*/
#include "hap.h"
int
ff_hap_set_chunk_count
(
HapContext
*
ctx
,
int
count
,
int
first_in_frame
)
{
int
ret
=
0
;
if
(
first_in_frame
==
1
&&
ctx
->
chunk_count
!=
count
)
{
int
ret
=
av_reallocp_array
(
&
ctx
->
chunks
,
count
,
sizeof
(
HapChunk
));
if
(
ret
==
0
)
ret
=
av_reallocp_array
(
&
ctx
->
chunk_results
,
count
,
sizeof
(
int
));
if
(
ret
<
0
)
{
ctx
->
chunk_count
=
0
;
}
else
{
ctx
->
chunk_count
=
count
;
}
}
else
if
(
ctx
->
chunk_count
!=
count
)
{
/* If this is not the first chunk count calculated for a frame and a
* different count has already been encountered, then reject the frame:
* each table in the Decode Instructions Container must describe the
* same number of chunks. */
ret
=
AVERROR_INVALIDDATA
;
}
return
ret
;
}
av_cold
void
ff_hap_free_context
(
HapContext
*
ctx
)
{
av_freep
(
&
ctx
->
tex_buf
);
av_freep
(
&
ctx
->
chunks
);
av_freep
(
&
ctx
->
chunk_results
);
}
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