You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
265 lines
7.4 KiB
265 lines
7.4 KiB
package vendor.hardware.hwnxmediaplayerhal@1.0;
|
|
|
|
import IMediaCallBack;
|
|
import android.hardware.graphics.bufferqueue@2.0::IGraphicBufferProducer;
|
|
|
|
interface INxMediaPlayer
|
|
{
|
|
/**
|
|
*play back speed
|
|
*/
|
|
struct HPlaybackRate {
|
|
float mSpeed;
|
|
};
|
|
|
|
/**
|
|
*play back seek mode
|
|
*/
|
|
enum HMediaPlayerSeekMode : int32_t {
|
|
NX_PLAYER_SEEK_NONE = 0,
|
|
NX_PLAYER_SEEK_PRE_KEY = 1,
|
|
NX_PLAYER_SEEK_NXT_KEY = 2,
|
|
NX_PLAYER_SEEK_CLOSEST_KEY = 3,
|
|
NX_PLAYER_SEEK_CLOSEST_ANY =4,
|
|
NX_PLAYER_SEEK_BUTT = 5,
|
|
};
|
|
|
|
/**
|
|
*Init some resource.
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
init() generates (int32_t ret);
|
|
|
|
/**
|
|
*set uid
|
|
*@param uid
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setUID(uint32_t uid) generates (int32_t ret);
|
|
|
|
/**
|
|
*Sets the data source as a content Url
|
|
*@param url the Content URI of the data you want to play
|
|
*@param headers the headers to be sent together with the request for the data
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setDataSourceUrl(string url, vec<Header> headers) generates (int32_t ret);
|
|
|
|
/**
|
|
*Set fd data source to play
|
|
*@param fdHandle the the fdHandle for the file you want to play
|
|
*@param offset the offset into the file where the data to be played starts, in bytes
|
|
*@param length the length in bytes of the data to be played
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setDataSourceFd(handle fdHandle, int64_t offset, int64_t length) generates (int32_t ret);
|
|
|
|
/**
|
|
*Set the surface for rendering video
|
|
*@param bufferProducer to be used for the video portion of media
|
|
*@param isSurfaceView the surface type associated with IGraphicBufferProducer is surfaceview or not
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setSurfaceTexture(@2.0::IGraphicBufferProducer bufferProducer, int32_t isSurfaceView) generates (int32_t ret);
|
|
|
|
/**
|
|
*Set the surface for rendering subtitle
|
|
*@param bufferProducer to be used for the subtitle portion of media
|
|
*@param isSurfaceView the surface type associated with IGraphicBufferProducer is surfaceview or not
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setSubtitleSurface(@2.0::IGraphicBufferProducer bufferProducer, int32_t isSurfaceView) generates (int32_t ret);
|
|
/**
|
|
*set video scaling mode
|
|
*@param scalingmode mode
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setVideoScaling(int32_t scalingmode) generates (int32_t ret);
|
|
|
|
/**
|
|
*Set volume
|
|
*@param leftVolume left volume scalar
|
|
*@param rightVolume right volume scalar
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setVolume(float leftVolume, float rightVolume) generates (int32_t ret);
|
|
|
|
/**
|
|
*Prepare sync or async
|
|
*@param sync 1 is sync; 0 is async
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
prepare(int32_t sync) generates (int32_t ret);
|
|
|
|
/**
|
|
*start play
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
start() generates (int32_t ret);
|
|
|
|
/**
|
|
*stop play
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
stop() generates (int32_t ret);
|
|
|
|
/**
|
|
*pause play
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
pause() generates (int32_t ret);
|
|
|
|
/**
|
|
*get playback status
|
|
*@return status 0, success
|
|
* !0 fail
|
|
*/
|
|
getPlayStatus() generates (int32_t status);
|
|
|
|
/**
|
|
*get playback rate
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return rate play back rate
|
|
*/
|
|
getPlaybackSettings() generates (int32_t ret, HPlaybackRate rate);
|
|
|
|
/**
|
|
*get playback rate
|
|
*@param rate play back rate
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setPlaybackSettings(HPlaybackRate rate) generates (int32_t ret);
|
|
|
|
/**
|
|
*seek to msec with mode
|
|
*@param msec the offset in milliseconds from the start to seek to
|
|
*@param mode seek mode
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
seekTo(int32_t msec, HMediaPlayerSeekMode mode) generates (int32_t ret);
|
|
|
|
/**
|
|
*get the cuurent position of playback
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return hidlMsec the current position in milliseconds
|
|
*/
|
|
getCurrentPosition() generates (int32_t ret, int32_t hidlMsec);
|
|
|
|
/**
|
|
*get the duration of stream source
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return msec the duration in milliseconds
|
|
*/
|
|
getDuration() generates (int32_t ret, int32_t msec);
|
|
|
|
/**
|
|
*reset player
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
reset() generates (int32_t ret);
|
|
|
|
/**
|
|
*Sets the player to be looping or non-looping
|
|
*@param loop whether to loop or not
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setLooping(int32_t loop) generates (int32_t ret);
|
|
|
|
/**
|
|
*get track info
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@replyString track info
|
|
*/
|
|
getTrackInfo() generates (int32_t ret, string replyString);
|
|
|
|
/**
|
|
*add timed text source
|
|
*@param fdHandle the the fdHandle for the file you want to add
|
|
*@param offset the offset into the file where the data to start, in bytes
|
|
*@param length the length in bytes of the data
|
|
*@param mimeType mime Type
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
addTimedTextSource(handle fdHandle, int64_t offset, int64_t length, string mimeType) generates (int32_t ret);
|
|
|
|
/**
|
|
*select/unselect one track
|
|
*@param trackIndex index the index of the track to be selected/unselect
|
|
*@param select whether select or unselect
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
selectTrack(int32_t trackIndex, int32_t select) generates (int32_t ret);
|
|
|
|
/**
|
|
*get audio/video/subtitle track index
|
|
*@param trackType audio/video/subtitle
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return replyString track inf corresponding to type
|
|
*/
|
|
getSelectedTrack(int32_t trackType) generates (int32_t ret, string replyString);
|
|
|
|
/**
|
|
*get parameter corresponding to key
|
|
*@param key indicate which parameter we want to get
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return replyString the parameter we want
|
|
*/
|
|
getParameter(int32_t key) generates (int32_t ret, string replyString);
|
|
|
|
/**
|
|
*set parameter corresponding to key
|
|
*@param key indicate which parameter we want to get
|
|
*@param request the parameter we want to set
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*/
|
|
setParameter(int32_t key, string request) generates (int32_t ret);
|
|
|
|
/**
|
|
*invoke with request and get reply
|
|
*@param request request data
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return replyString reply data for request
|
|
*/
|
|
invoke(string request) generates (int32_t ret, string replyString);
|
|
|
|
/**
|
|
*Gets the media metadata
|
|
*@return ret 0, success
|
|
* !0 fail
|
|
*@return recordsString metadata returned
|
|
*/
|
|
getMetadata() generates (int32_t ret, string recordsString);
|
|
|
|
/**
|
|
*set IMediaCallBack to INxMediaPlayer for callback
|
|
*@param callback the callback interface
|
|
*/
|
|
setNotifyCallback(IMediaCallBack callback);
|
|
};
|