Browse files

add video decoder

  • Loading branch information...
1 parent e9a7224 commit 67a901e116c28dec39e9e13988f4f82bd6d7e41b @havlenapetr committed Jul 31, 2010
View
3 jni/libmediaplayer/Android.mk
@@ -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
View
7 jni/libmediaplayer/decoder_audio.cpp
@@ -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"
View
36 jni/libmediaplayer/decoder_video.cpp
@@ -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;
+}
View
20 jni/libmediaplayer/decoder_video.h
@@ -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.