Skip to content

Commit

Permalink
add video decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
havlenapetr committed Jul 31, 2010
1 parent e9a7224 commit 67a901e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 7 deletions.
3 changes: 2 additions & 1 deletion jni/libmediaplayer/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ LOCAL_SRC_FILES += \
mediaplayer.cpp \
packetqueue.cpp \
decoder.cpp \
decoder_audio.cpp
decoder_audio.cpp \
decoder_video.cpp

LOCAL_LDLIBS := -llog

Expand Down
7 changes: 1 addition & 6 deletions jni/libmediaplayer/decoder_audio.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#include <android/log.h>
#include "decoder_audio.h"

extern "C" {

#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"

} // end of extern C
#include <drivers_map.h>

#define TAG "FFMpegAudioDecoder"

Expand Down
36 changes: 36 additions & 0 deletions jni/libmediaplayer/decoder_video.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <android/log.h>
#include "decoder_video.h"

#define TAG "FFMpegVideoDecoder"

static DecoderVideo* sInstance;

DecoderVideo::DecoderVideo(AVCodecContext* codec_ctx)
{
mQueue = new PacketQueue();
mCodecCtx = codec_ctx;
sInstance = this;
}

DecoderVideo::~DecoderVideo()
{
if(mDecoding)
{
stop();
}
}

bool DecoderVideo::prepare(const char *err)
{
return false;
}

bool DecoderVideo::process(AVPacket *packet)
{
return false;
}

bool DecoderVideo::decode(void* ptr)
{
return false;
}
20 changes: 20 additions & 0 deletions jni/libmediaplayer/decoder_video.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef FFMPEG_DECODER_VIDEO_H
#define FFMPEG_DECODER_VIDEO_H

#include "decoder.h"

class DecoderVideo : public IDecoder
{
public:
DecoderVideo(AVCodecContext* codec_ctx);

~DecoderVideo();

private:

bool prepare(const char *err);
bool decode(void* ptr);
bool process(AVPacket *packet);
};

#endif //FFMPEG_DECODER_AUDIO_H

0 comments on commit 67a901e

Please sign in to comment.