Skip to content

Commit

Permalink
Upgrade to V1.1.0.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
jinbangfei committed May 23, 2017
1 parent 6a2a993 commit be333e9
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 120 deletions.
Binary file modified android/qplayerTest/app/libs/armeabi-v7a/libQPlayer.so
Binary file not shown.
Binary file not shown.
Binary file modified android/qplayerTest/app/libs/armeabi-v7a/libqcCodec.so
Binary file not shown.
Binary file modified android/qplayerTest/app/libs/x86/libQPlayer.so
Binary file not shown.
Binary file removed android/qplayerTest/app/libs/x86/libqcAACDec.so
Binary file not shown.
Binary file modified android/qplayerTest/app/libs/x86/libqcCodec.so
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public interface BasePlayer {

// define the param id
public static final int PARAM_PID_EVENT_DONE = 0X100;
// get: the param is null, set the param is 0 -100
public static final int PARAM_PID_AUDIO_VOLUME = 0X101;

// the param should be double
public static final int QCPLAY_PID_Speed = 0X11000002;
// the param shoud be 1 disable video rnd, 0 enable render.
Expand All @@ -43,12 +46,35 @@ public interface BasePlayer {
public static final int QC_MSG_PLAY_SEEK_FAILED = 0x16000006;
// The first frame video was displayed.
public static final int QC_MSG_SNKV_FIRST_FRAME = 0x15200001;

public static final int QC_MSG_PLAY_RUN = 0x1600000C;
public static final int QC_MSG_PLAY_PAUSE = 0x1600000D;
public static final int QC_MSG_PLAY_STOP = 0x1600000E;


// http protocol messaage id
public static final int QC_MSG_HTTP_CONNECT_START = 0x11000001;
public static final int QC_MSG_HTTP_CONNECT_FAILED = 0x11000002;
public static final int QC_MSG_HTTP_CONNECT_SUCESS = 0x11000003;
public static final int QC_MSG_HTTP_DNS_START = 0x11000004;
public static final int QC_MSG_HTTP_REDIRECT = 0x11000012;
public static final int QC_MSG_HTTP_DISCONNECT_START = 0x11000021;
public static final int QC_MSG_HTTP_DISCONNECT_DONE = 0x11000022;
public static final int QC_MSG_HTTP_DOWNLOAD_SPEED = 0x11000030;
public static final int QC_MSG_HTTP_DISCONNECTED = 0x11000050;
public static final int QC_MSG_HTTP_RECONNECT_FAILED = 0x11000051;
public static final int QC_MSG_HTTP_RECONNECT_SUCESS = 0x11000052;

public static final int QC_MSG_RTMP_CONNECT_START = 0x11010001;
public static final int QC_MSG_RTMP_CONNECT_FAILED = 0x11010002;
public static final int QC_MSG_RTMP_CONNECT_SUCESS = 0x11010003;
public static final int QC_MSG_RTMP_DOWNLOAD_SPEED = 0x11010004;

public static final int QC_MSG_BUFF_VBUFFTIME = 0x18000001;
public static final int QC_MSG_BUFF_ABUFFTIME = 0x18000002;

public static final int QC_MSG_HTTP_DISCONNECTED = 0x11000050;
public static final int QC_MSG_HTTP_RECONNECT_FAILED = 0x11000051;
public static final int QC_MSG_HTTP_RECONNECT_SUCESS = 0x11000052;


public static final int QC_MSG_BUFF_START_BUFFERING = 0x18000006;
public static final int QC_MSG_BUFF_END_BUFFERING = 0x18000007;

// The video size was changed. The player need to resize the
// surface pos and size.
Expand All @@ -74,14 +100,13 @@ public interface onEventListener{
public long GetDuration();
public int GetPos();
public int SetPos(int nPos);
public int WaitRendTime (long lTime);
public int GetParam(int nParamId, int nParam, Object objParam);
public int SetParam(int nParamId, int nParam, Object objParam);
public void Uninit();

public int GetVideoWidth();
public int GetVideoHeight();
public void SetVolume(float left, float right);
public void SetVolume(int nVolume);
public int GetStreamNum ();
public int SetStreamPlay (int nStream);
public int GetStreamPlay ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Change History (most recent first):
package com.qiniu.qplayer.mediaEngine;

import android.content.Context;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Message;
import android.view.Surface;
Expand Down Expand Up @@ -46,8 +47,8 @@ public class MediaPlayer implements BasePlayer {
private int m_nVideoHeight = 0;
private int m_nSampleRate = 0;
private int m_nChannels = 0;
private int m_nBTOffset = 0;

private AudioRender m_AudioRender = null;
private onEventListener m_EventListener = null;

static {
Expand All @@ -57,6 +58,9 @@ public class MediaPlayer implements BasePlayer {
public int Init(Context context, String apkPath, int nFlag) {
m_context = context;
m_nInitFlag = nFlag;
AudioManager am = (AudioManager)context.getSystemService(context.AUDIO_SERVICE);
if (am != null && am.isBluetoothA2dpOn())
m_nBTOffset = 250;
m_NativeContext = nativeInit(new WeakReference<MediaPlayer>(this), apkPath, nFlag);
if (m_NativeContext == 0)
return -1;
Expand Down Expand Up @@ -109,10 +113,6 @@ public int SetPos(int nPos) {
return nativeSetPos(m_NativeContext, nPos);
}

public int WaitRendTime(long lTime) {
return nativeWaitRendTime(m_NativeContext, (int) lTime);
}

public int GetParam(int nParamId, int nParam, Object objParam) {
return nativeGetParam(m_NativeContext, nParamId, nParam, objParam);
}
Expand All @@ -122,10 +122,7 @@ public int SetParam(int nParamId, int nParam, Object objParam) {
}

public void Uninit() {
if (m_AudioRender != null)
m_AudioRender.closeTrack();
nativeUninit(m_NativeContext);
m_AudioRender = null;
}

public int GetVideoWidth() {
Expand All @@ -136,9 +133,8 @@ public int GetVideoHeight() {
return m_nVideoHeight;
}

public void SetVolume(float left, float right) {
if (m_AudioRender != null)
m_AudioRender.SetVolume(left, right);
public void SetVolume(int nVolume) {
SetParam (PARAM_PID_AUDIO_VOLUME, nVolume, null);
}

public int GetStreamNum() {
Expand Down Expand Up @@ -167,7 +163,7 @@ public int GetStreamBitrate (int nStream) {


public void OnOpenComplete () {

SetParam (QCPLAY_PID_Clock_OffTime, m_nBTOffset, null);
}

public void onVideoSizeChanged () {
Expand Down Expand Up @@ -208,10 +204,6 @@ else if (what == QC_MSG_SNKA_NEW_FORMAT)
{
player.m_nSampleRate = ext1;
player.m_nChannels = ext2;

if (player.m_AudioRender == null)
player.m_AudioRender = new AudioRender(player.m_context, player);
player.m_AudioRender.openTrack (player.m_nSampleRate, player.m_nChannels);
return;
}
Message msg = player.mHandle.obtainMessage(what, obj);
Expand All @@ -223,7 +215,6 @@ private static void audioDataFromNative(Object baselayer_ref, byte[] data, int s
MediaPlayer player = (MediaPlayer)((WeakReference)baselayer_ref).get();
if (player == null)
return;
player.m_AudioRender.writeData(data, size);
}

private static void videoDataFromNative(Object baselayer_ref, byte[] data, int size, int lTime, int nFlag)
Expand Down Expand Up @@ -264,7 +255,6 @@ public void handleMessage(Message msg)
private native int nativeGetPos(int nNativeContext);
private native int nativeSetPos(int nNativeContext,int nPos);
private native long nativeGetDuration(int nNativeContext);
private native int nativeWaitRendTime(int nNativeContext, int lTime);
private native int nativeGetParam(int nNativeContext,int nParamId, int nParam, Object objParam);
private native int nativeSetParam(int nNativeContext,int nParamId, int nParam, Object objParam);
}
Binary file modified win32/SamplePlayer/bin/QPlayEng.Dll
Binary file not shown.
Binary file modified win32/SamplePlayer/bin/TestCode.exe
Binary file not shown.
Binary file removed win32/SamplePlayer/bin/qcAACDec.dll
Binary file not shown.
Binary file modified win32/SamplePlayer/bin/qcCodec.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions win32/SamplePlayer/include/qcCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ typedef struct
int nChannels;
int nFormat;
int nNBSamples;
char * pDataBuff[3];
int nDataSize[3];
char * pDataBuff[8];
int nDataSize[8];
} QC_AUDIO_FRAME;

/**
Expand Down
7 changes: 7 additions & 0 deletions win32/SamplePlayer/include/qcData.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ typedef enum {
QC_PARSER_MP4,
QC_PARSER_FLV,
QC_PARSER_TS,
QC_PARSER_MP3,
QC_PARSER_AAC,
QC_PARSER_MAX = 0X7FFFFFFF
}QCParserFormat;

Expand All @@ -56,6 +58,7 @@ typedef enum {
// audio codecs
QC_CODEC_ID_AAC = 0x10000,
QC_CODEC_ID_MP3,
QC_CODEC_ID_MP2,
QC_CODEC_ID_MAX = 0X7FFFFFFF
}QCCodecID;

Expand Down Expand Up @@ -193,6 +196,8 @@ typedef enum {
#ifdef __cplusplus
class CBuffMng;
#endif /* __cplusplus */
typedef int (*QC_FREE_BUFF) (void * pUser, void * pBuff);

typedef struct
{
QCMediaType nMediaType; /*!< buffer type */
Expand All @@ -214,6 +219,8 @@ typedef struct
CBuffMng * pBuffMng;
int nUsed; /*!< The buffer used times. It can free when is 0 */
#endif // __cplusplus
void * pUserData;
QC_FREE_BUFF fFreeBuff;
// for buffer track info
#ifdef __QC_BUFF_TRACE__
int nBuffID;
Expand Down
19 changes: 17 additions & 2 deletions win32/SamplePlayer/include/qcMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@
#define QC_MSG_HTTP_DOWNLOAD_SPEED 0x11000030 // Param: int speed
#define QC_MSG_HTTP_DISCONNECTED 0x11000050 // Param:
#define QC_MSG_HTTP_RECONNECT_FAILED 0x11000051 // Param:
#define QC_MSG_HTTP_RECONNECT_SUCESS 0x11000052 // Param:
#define QC_MSG_HTTP_RECONNECT_SUCESS 0x11000052 // Param:

#define QC_MSG_RTMP_CONNECT_START 0x11010001 // Param: URL.
#define QC_MSG_RTMP_CONNECT_FAILED 0x11010002 // Param:
#define QC_MSG_RTMP_CONNECT_SUCESS 0x11010003 // Param:
#define QC_MSG_RTMP_DOWNLOAD_SPEED 0x11010004 // Param: int speed
#define QC_MSG_RTMP_DNS_GET_IPADDR 0x11010005 // Param:

#define QC_MSG_IO_FIRST_BYTE_DONE 0x11020001 // Param:


// define the parser msg ID
#define QC_MSG_PARSER_BASE 0x12000000
Expand Down Expand Up @@ -85,10 +94,16 @@
// define the buffer msg ID
#define QC_MSG_BUFF_VBUFFTIME 0x18000001 //param: video buff time
#define QC_MSG_BUFF_ABUFFTIME 0x18000002 //param: audio buff time
#define QC_MSG_BUFF_GOPTIME 0x18000003 //param: video GOP time

#define QC_MSG_BUFF_NEWSTREAM 0x18000004 //param:
#define QC_MSG_BUFF_START_BUFFERING 0x18000006 //param: playing time
#define QC_MSG_BUFF_END_BUFFERING 0x18000007 //param:
#define QC_MSG_BUFF_END_BUFFERING 0x18000007 //param:

// define the render msg ID
#define QC_MSG_RENDER_BASE 0x19000000
#define QC_MSG_RENDER_VIDEO_FPS 0x19000001 //param: fps of video render



#endif // __QCMSG_H__
6 changes: 6 additions & 0 deletions win32/SamplePlayer/include/qcParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ DLLEXPORT_C int qcCreateParser (QC_Parser_Func * pParser, QCParserFormat nForma
// destory the Parser
DLLEXPORT_C int qcDestroyParser (QC_Parser_Func * pParser);

DLLEXPORT_C int ffCreateParser(QC_Parser_Func * pParser, QCParserFormat nFormat);
typedef int (*FFCREATEPARSER) (QC_Parser_Func * pParser, QCParserFormat nFormat);

DLLEXPORT_C int ffDestroyParser(QC_Parser_Func * pParser);
typedef int (*FFDESTROYPARSER) (QC_Parser_Func * pParser);

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
Expand Down

0 comments on commit be333e9

Please sign in to comment.