FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavcodec
mediacodecdec_common.h
Go to the documentation of this file.
1
/*
2
* Android MediaCodec decoder
3
*
4
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
5
*
6
* This file is part of FFmpeg.
7
*
8
* FFmpeg is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* FFmpeg is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with FFmpeg; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
#ifndef AVCODEC_MEDIACODECDEC_COMMON_H
24
#define AVCODEC_MEDIACODECDEC_COMMON_H
25
26
#include <stdint.h>
27
#include <stdatomic.h>
28
#include <sys/types.h>
29
30
#include "
libavutil/frame.h
"
31
#include "
libavutil/pixfmt.h
"
32
33
#include "
avcodec.h
"
34
#include "
mediacodec_wrapper.h
"
35
36
typedef
struct
MediaCodecDecContext
{
37
38
atomic_int
refcount
;
39
40
char
*
codec_name
;
41
42
FFAMediaCodec
*
codec
;
43
FFAMediaFormat
*
format
;
44
45
void
*
surface
;
46
47
int
started
;
48
int
draining
;
49
int
flushing
;
50
int
eos
;
51
52
int
width
;
53
int
height
;
54
int
stride
;
55
int
slice_height
;
56
int
color_format
;
57
enum
AVPixelFormat
pix_fmt
;
58
int
crop_top
;
59
int
crop_bottom
;
60
int
crop_left
;
61
int
crop_right
;
62
63
uint64_t
output_buffer_count
;
64
65
}
MediaCodecDecContext
;
66
67
int
ff_mediacodec_dec_init
(
AVCodecContext
*avctx,
68
MediaCodecDecContext
*
s
,
69
const
char
*mime,
70
FFAMediaFormat
*
format
);
71
72
int
ff_mediacodec_dec_decode
(
AVCodecContext
*avctx,
73
MediaCodecDecContext
*
s
,
74
AVFrame
*
frame
,
75
int
*got_frame,
76
AVPacket
*
pkt
);
77
78
int
ff_mediacodec_dec_flush
(
AVCodecContext
*avctx,
79
MediaCodecDecContext
*
s
);
80
81
int
ff_mediacodec_dec_close
(
AVCodecContext
*avctx,
82
MediaCodecDecContext
*
s
);
83
84
int
ff_mediacodec_dec_is_flushing
(
AVCodecContext
*avctx,
85
MediaCodecDecContext
*
s
);
86
87
typedef
struct
MediaCodecBuffer
{
88
89
MediaCodecDecContext
*
ctx
;
90
ssize_t
index
;
91
int64_t
pts
;
92
atomic_int
released
;
93
94
}
MediaCodecBuffer
;
95
96
#endif
/* AVCODEC_MEDIACODECDEC_COMMON_H */
mediacodec_wrapper.h
s
const char * s
Definition:
avisynth_c.h:768
AVFrame
This structure describes decoded (raw) audio or video data.
Definition:
frame.h:201
MediaCodecDecContext
Definition:
mediacodecdec_common.h:36
MediaCodecDecContext::stride
int stride
Definition:
mediacodecdec_common.h:54
ff_mediacodec_dec_is_flushing
int ff_mediacodec_dec_is_flushing(AVCodecContext *avctx, MediaCodecDecContext *s)
Definition:
mediacodecdec_common.c:756
ff_mediacodec_dec_init
int ff_mediacodec_dec_init(AVCodecContext *avctx, MediaCodecDecContext *s, const char *mime, FFAMediaFormat *format)
Definition:
mediacodecdec_common.c:460
MediaCodecDecContext::eos
int eos
Definition:
mediacodecdec_common.h:50
MediaCodecDecContext::height
int height
Definition:
mediacodecdec_common.h:53
FFAMediaFormat
Definition:
mediacodec_wrapper.c:158
pkt
static AVPacket pkt
Definition:
demuxing_decoding.c:54
atomic_int
intptr_t atomic_int
Definition:
stdatomic.h:55
MediaCodecDecContext::width
int width
Definition:
mediacodecdec_common.h:52
ff_mediacodec_dec_close
int ff_mediacodec_dec_close(AVCodecContext *avctx, MediaCodecDecContext *s)
Definition:
mediacodecdec_common.c:749
MediaCodecBuffer
Opaque structure representing a MediaCodec buffer to render.
Definition:
mediacodecdec_common.h:87
ff_mediacodec_dec_decode
int ff_mediacodec_dec_decode(AVCodecContext *avctx, MediaCodecDecContext *s, AVFrame *frame, int *got_frame, AVPacket *pkt)
Definition:
mediacodecdec_common.c:546
MediaCodecBuffer::pts
int64_t pts
Definition:
mediacodecdec_common.h:91
MediaCodecBuffer::index
ssize_t index
Definition:
mediacodecdec_common.h:90
frame
static AVFrame * frame
Definition:
demuxing_decoding.c:53
MediaCodecDecContext::crop_right
int crop_right
Definition:
mediacodecdec_common.h:61
MediaCodecDecContext::started
int started
Definition:
mediacodecdec_common.h:47
ff_mediacodec_dec_flush
int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s)
Definition:
mediacodecdec_common.c:731
MediaCodecDecContext::pix_fmt
enum AVPixelFormat pix_fmt
Definition:
mediacodecdec_common.h:57
MediaCodecDecContext::surface
void * surface
Definition:
mediacodecdec_common.h:45
MediaCodecDecContext::output_buffer_count
uint64_t output_buffer_count
Definition:
mediacodecdec_common.h:63
frame.h
reference-counted frame API
MediaCodecDecContext::color_format
int color_format
Definition:
mediacodecdec_common.h:56
MediaCodecDecContext::crop_bottom
int crop_bottom
Definition:
mediacodecdec_common.h:59
MediaCodecBuffer::ctx
MediaCodecDecContext * ctx
Definition:
mediacodecdec_common.h:89
MediaCodecDecContext::flushing
int flushing
Definition:
mediacodecdec_common.h:49
MediaCodecDecContext::refcount
atomic_int refcount
Definition:
mediacodecdec_common.h:38
MediaCodecDecContext::crop_left
int crop_left
Definition:
mediacodecdec_common.h:60
MediaCodecDecContext::draining
int draining
Definition:
mediacodecdec_common.h:48
avcodec.h
Libavcodec external API header.
AVCodecContext
main external API structure.
Definition:
avcodec.h:1761
format
static const char * format
Definition:
movenc.c:47
MediaCodecDecContext::codec
FFAMediaCodec * codec
Definition:
mediacodecdec_common.h:42
MediaCodecDecContext::format
FFAMediaFormat * format
Definition:
mediacodecdec_common.h:43
FFAMediaCodec
Definition:
mediacodec_wrapper.c:270
MediaCodecDecContext::crop_top
int crop_top
Definition:
mediacodecdec_common.h:58
pixfmt.h
pixel format definitions
MediaCodecDecContext::slice_height
int slice_height
Definition:
mediacodecdec_common.h:55
MediaCodecBuffer::released
atomic_int released
Definition:
mediacodecdec_common.h:92
AVPixelFormat
AVPixelFormat
Pixel format.
Definition:
pixfmt.h:60
AVPacket
This structure stores compressed data.
Definition:
avcodec.h:1656
MediaCodecDecContext::codec_name
char * codec_name
Definition:
mediacodecdec_common.h:40
Generated on Fri Jan 12 2018 01:47:44 for FFmpeg by
1.8.6