• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修訂67047481a79534f2d35455d955f7cc01df4ec31e (tree)
時間2010-11-19 19:03:28
作者Owen Kwon <pinebud@gmai...>
CommiterChih-Wei Huang

Log Message

enable mplayer as the default player if BUILD_WITH_MPLAYER is true

Change Summary

差異

--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -41,10 +41,11 @@ enum player_type {
4141 SONIVOX_PLAYER = 2,
4242 VORBIS_PLAYER = 3,
4343 STAGEFRIGHT_PLAYER = 4,
44+ MPLAYER_PLAYER = 5,
4445 // Test players are available only in the 'test' and 'eng' builds.
4546 // The shared library with the test player is passed passed as an
4647 // argument to the 'test:' url in the setDataSource call.
47- TEST_PLAYER = 5,
48+ TEST_PLAYER = 6,
4849 };
4950
5051
--- a/media/java/android/media/MediaFile.java
+++ b/media/java/android/media/MediaFile.java
@@ -63,8 +63,10 @@ public class MediaFile {
6363 public static final int FILE_TYPE_3GPP2 = 24;
6464 public static final int FILE_TYPE_WMV = 25;
6565 public static final int FILE_TYPE_ASF = 26;
66+ public static final int FILE_TYPE_AVI = 27;
67+ public static final int FILE_TYPE_MKV = 28;
6668 private static final int FIRST_VIDEO_FILE_TYPE = FILE_TYPE_MP4;
67- private static final int LAST_VIDEO_FILE_TYPE = FILE_TYPE_ASF;
69+ private static final int LAST_VIDEO_FILE_TYPE = FILE_TYPE_MKV;
6870
6971 // Image file types
7072 public static final int FILE_TYPE_JPEG = 31;
@@ -145,6 +147,8 @@ public class MediaFile {
145147 addFileType("OTA", FILE_TYPE_MID, "audio/midi");
146148
147149 addFileType("MPEG", FILE_TYPE_MP4, "video/mpeg");
150+ addFileType("AVI", FILE_TYPE_AVI, "video/avi");
151+ addFileType("MKV", FILE_TYPE_MKV, "video/mkv");
148152 addFileType("MP4", FILE_TYPE_MP4, "video/mp4");
149153 addFileType("M4V", FILE_TYPE_M4V, "video/mp4");
150154 addFileType("3GP", FILE_TYPE_3GPP, "video/3gpp");
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -62,6 +62,12 @@ LOCAL_C_INCLUDES := \
6262 $(TOP)/frameworks/base/media/libstagefright/include \
6363 $(TOP)/external/tremolo/Tremolo
6464
65+ifeq ($(BUILD_WITH_MPLAYER),true)
66+LOCAL_CFLAGS += -DBUILD_WITH_MPLAYER=1
67+LOCAL_SHARED_LIBRARIES += libandroidmplayer
68+LOCAL_C_INCLUDES += external/mplayer
69+endif
70+
6571 LOCAL_MODULE:= libmediaplayerservice
6672
6773 include $(BUILD_SHARED_LIBRARY)
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -60,6 +60,9 @@
6060 #include <media/PVPlayer.h>
6161 #include "TestPlayerStub.h"
6262 #include "StagefrightPlayer.h"
63+#ifdef BUILD_WITH_MPLAYER
64+#include "MPlayer.h"
65+#endif
6366
6467 #include <OMX.h>
6568
@@ -199,6 +202,15 @@ extmap FILE_EXTS [] = {
199202 {".ota", SONIVOX_PLAYER},
200203 {".ogg", VORBIS_PLAYER},
201204 {".oga", VORBIS_PLAYER},
205+#ifdef BUILD_WITH_MPLAYER
206+#ifndef NO_OPENCORE
207+ {".m4a", PV_PLAYER},
208+ {".mp3", PV_PLAYER},
209+#endif
210+ {".mp4", MPLAYER_PLAYER},
211+ {".avi", MPLAYER_PLAYER},
212+ {".mkv", MPLAYER_PLAYER},
213+#endif
202214 #ifndef NO_OPENCORE
203215 {".wma", PV_PLAYER},
204216 {".wmv", PV_PLAYER},
@@ -667,6 +679,9 @@ void MediaPlayerService::Client::disconnect()
667679 }
668680
669681 static player_type getDefaultPlayerType() {
682+#ifdef BUILD_WITH_MPLAYER
683+ return MPLAYER_PLAYER;
684+#endif
670685 #if BUILD_WITH_FULL_STAGEFRIGHT
671686 char value[PROPERTY_VALUE_MAX];
672687 if (property_get("media.stagefright.enable-player", value, NULL)
@@ -719,6 +734,11 @@ player_type getPlayerType(int fd, int64_t offset, int64_t length)
719734 }
720735 #endif
721736
737+#ifdef BUILD_WITH_MPLAYER
738+ if (ident == 0x03334449 || ident == 20000000)
739+ return PV_PLAYER;
740+#endif
741+
722742 // Some kind of MIDI?
723743 EAS_DATA_HANDLE easdata;
724744 if (EAS_Init(&easdata) == EAS_SUCCESS) {
@@ -788,6 +808,12 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
788808 {
789809 sp<MediaPlayerBase> p;
790810 switch (playerType) {
811+#ifdef BUILD_WITH_MPLAYER
812+ case MPLAYER_PLAYER:
813+ LOGV(" create MPlayer");
814+ p = new MPlayer();
815+ break;
816+#endif
791817 #ifndef NO_OPENCORE
792818 case PV_PLAYER:
793819 LOGV(" create PVPlayer");