Commit cae9e8d8 authored by Thomas Guillem's avatar Thomas Guillem

mediacodec: add JNI module

Add the mc_api struct, used by Decoder to access a MediaCodec API.
parent ac4a4aee
...@@ -397,7 +397,8 @@ libiomx_plugin_la_CPPFLAGS = $(libomxil_plugin_la_CPPFLAGS) -DUSE_IOMX ...@@ -397,7 +397,8 @@ libiomx_plugin_la_CPPFLAGS = $(libomxil_plugin_la_CPPFLAGS) -DUSE_IOMX
libiomx_plugin_la_LIBADD = $(libomxil_plugin_la_LIBADD) libiomx_plugin_la_LIBADD = $(libomxil_plugin_la_LIBADD)
libmediacodec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/codec/omxil libmediacodec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/codec/omxil
libmediacodec_plugin_la_SOURCES = codec/omxil/mediacodec.c codec/omxil/utils.c \ libmediacodec_plugin_la_SOURCES = codec/omxil/mediacodec.c codec/omxil/mediacodec.h \
codec/omxil/mediacodec_jni.c codec/omxil/utils.c \
video_chroma/copy.c codec/omxil/android_opaque.c codec/omxil/android_opaque.h \ video_chroma/copy.c codec/omxil/android_opaque.c codec/omxil/android_opaque.h \
packetizer/h264_nal.c packetizer/h264_nal.h packetizer/h264_nal.c packetizer/h264_nal.h
packetizer/hevc_nal.c packetizer/hevc_nal.h packetizer/hevc_nal.c packetizer/hevc_nal.h
......
This diff is collapsed.
/*****************************************************************************
* mediacodec.h: Video decoder module using the Android MediaCodec API
*****************************************************************************
* Copyright © 2015 VLC authors and VideoLAN, VideoLabs
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_MEDIACODEC_H
#define VLC_MEDIACODEC_H
#include <vlc_common.h>
typedef struct mc_api mc_api;
typedef struct mc_api_sys mc_api_sys;
typedef struct mc_api_out mc_api_out;
typedef int (*pf_MediaCodecApi_init)(mc_api*);
int MediaCodecJni_Init(mc_api*);
struct mc_api_out
{
enum {
MC_OUT_TYPE_BUF,
MC_OUT_TYPE_CONF,
} type;
union
{
struct
{
int i_index;
mtime_t i_ts;
const void *p_ptr;
int i_size;
} buf;
struct
{
int width, height;
int stride;
int slice_height;
int pixel_format;
int crop_left;
int crop_top;
int crop_right;
int crop_bottom;
} conf;
} u;
};
struct mc_api
{
vlc_object_t *p_obj;
mc_api_sys *p_sys;
const char *psz_name;
bool b_started;
bool b_direct_rendering;
bool b_support_interlaced;
void (*clean)(mc_api *);
int (*start)(mc_api *, jobject jsurface, const char *psz_mime,
int i_width, int i_height,
size_t h264_profile, int i_angle);
int (*stop)(mc_api *);
int (*flush)(mc_api *);
int (*put_in)(mc_api *, const void *p_buf, size_t i_size,
mtime_t i_ts, bool b_config, mtime_t i_timeout);
int (*get_out)(mc_api *, mc_api_out *p_out, mtime_t i_timeout);
int (*release_out)(mc_api *, int i_index, bool b_render);
};
#endif
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment