FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
39 
40  char *codec_name;
41 
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;
58  int crop_top;
60  int crop_left;
62 
64 
66 
69  const char *mime,
71 
74  AVFrame *frame,
75  int *got_frame,
76  AVPacket *pkt);
77 
80 
83 
86 
87 typedef struct MediaCodecBuffer {
88 
90  ssize_t index;
91  int64_t pts;
93 
95 
96 #endif /* AVCODEC_MEDIACODECDEC_COMMON_H */
const char * s
Definition: avisynth_c.h:768
This structure describes decoded (raw) audio or video data.
Definition: frame.h:187
int ff_mediacodec_dec_is_flushing(AVCodecContext *avctx, MediaCodecDecContext *s)
int ff_mediacodec_dec_init(AVCodecContext *avctx, MediaCodecDecContext *s, const char *mime, FFAMediaFormat *format)
static AVPacket pkt
intptr_t atomic_int
Definition: stdatomic.h:55
int ff_mediacodec_dec_close(AVCodecContext *avctx, MediaCodecDecContext *s)
Opaque structure representing a MediaCodec buffer to render.
int ff_mediacodec_dec_decode(AVCodecContext *avctx, MediaCodecDecContext *s, AVFrame *frame, int *got_frame, AVPacket *pkt)
static AVFrame * frame
int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s)
enum AVPixelFormat pix_fmt
reference-counted frame API
MediaCodecDecContext * ctx
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1732
static const char * format
Definition: movenc.c:47
pixel format definitions
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
This structure stores compressed data.
Definition: avcodec.h:1634