mirror of https://github.com/FFmpeg/FFmpeg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.5 KiB
96 lines
2.5 KiB
9 years ago
|
/*
|
||
|
* Android MediaCodec decoder
|
||
|
*
|
||
|
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
||
|
*
|
||
|
* This file is part of FFmpeg.
|
||
|
*
|
||
|
* FFmpeg 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.
|
||
|
*
|
||
|
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
|
*/
|
||
|
|
||
8 years ago
|
#ifndef AVCODEC_MEDIACODECDEC_COMMON_H
|
||
|
#define AVCODEC_MEDIACODECDEC_COMMON_H
|
||
9 years ago
|
|
||
|
#include <stdint.h>
|
||
|
#include <sys/types.h>
|
||
|
|
||
|
#include "libavutil/frame.h"
|
||
|
#include "libavutil/pixfmt.h"
|
||
|
|
||
|
#include "avcodec.h"
|
||
|
#include "mediacodec_wrapper.h"
|
||
|
|
||
|
typedef struct MediaCodecDecContext {
|
||
|
|
||
9 years ago
|
volatile int refcount;
|
||
|
|
||
9 years ago
|
char *codec_name;
|
||
9 years ago
|
|
||
|
FFAMediaCodec *codec;
|
||
|
FFAMediaFormat *format;
|
||
|
|
||
9 years ago
|
void *surface;
|
||
|
|
||
9 years ago
|
int started;
|
||
9 years ago
|
int draining;
|
||
9 years ago
|
int flushing;
|
||
9 years ago
|
int eos;
|
||
9 years ago
|
|
||
|
int width;
|
||
|
int height;
|
||
|
int stride;
|
||
|
int slice_height;
|
||
|
int color_format;
|
||
|
enum AVPixelFormat pix_fmt;
|
||
|
int crop_top;
|
||
|
int crop_bottom;
|
||
|
int crop_left;
|
||
|
int crop_right;
|
||
|
|
||
8 years ago
|
uint64_t output_buffer_count;
|
||
9 years ago
|
|
||
|
} MediaCodecDecContext;
|
||
|
|
||
|
int ff_mediacodec_dec_init(AVCodecContext *avctx,
|
||
|
MediaCodecDecContext *s,
|
||
|
const char *mime,
|
||
|
FFAMediaFormat *format);
|
||
|
|
||
|
int ff_mediacodec_dec_decode(AVCodecContext *avctx,
|
||
|
MediaCodecDecContext *s,
|
||
|
AVFrame *frame,
|
||
|
int *got_frame,
|
||
|
AVPacket *pkt);
|
||
|
|
||
|
int ff_mediacodec_dec_flush(AVCodecContext *avctx,
|
||
|
MediaCodecDecContext *s);
|
||
|
|
||
|
int ff_mediacodec_dec_close(AVCodecContext *avctx,
|
||
|
MediaCodecDecContext *s);
|
||
|
|
||
9 years ago
|
int ff_mediacodec_dec_is_flushing(AVCodecContext *avctx,
|
||
|
MediaCodecDecContext *s);
|
||
|
|
||
|
typedef struct MediaCodecBuffer {
|
||
|
|
||
|
MediaCodecDecContext *ctx;
|
||
|
ssize_t index;
|
||
|
int64_t pts;
|
||
|
volatile int released;
|
||
|
|
||
|
} MediaCodecBuffer;
|
||
|
|
||
8 years ago
|
#endif /* AVCODEC_MEDIACODECDEC_COMMON_H */
|