1 /* 2 * Copyright 2019 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 * author: ywj@rock-chips.com 17 * fxw@rock-chips.com 18 * date: 2019/11/05 19 * module: RTTVPlayerInterface 20 */ 21 22 #ifndef INCLUDE_RT_PLAYER_RTTVPLAYERINTERFACE_H_ 23 #define INCLUDE_RT_PLAYER_RTTVPLAYERINTERFACE_H_ 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 #include <sys/types.h> 30 #include <inttypes.h> 31 #include "rt_metadata.h" // NOLINT 32 33 class IMediaDataSource; 34 35 class RTTVPlayerInterface { 36 public: RTTVPlayerInterface()37 RTTVPlayerInterface() {} ~RTTVPlayerInterface()38 virtual ~RTTVPlayerInterface() {} 39 40 /* parameter operations */ 41 virtual rt_status setDataSource(IMediaDataSource *ptr) = 0; 42 43 /* control operations */ 44 virtual rt_status prepare() = 0; 45 virtual rt_status prepareAsync() = 0;; 46 virtual rt_status seek() = 0; 47 virtual rt_status start() = 0; 48 virtual rt_status stop() = 0; 49 virtual rt_status pause() = 0; 50 virtual rt_status reset() = 0; 51 52 /* parameter query operations */ 53 virtual rt_status getState() = 0; 54 virtual rt_status getCurrentPosition(INT64 *usec) = 0; 55 virtual rt_status invoke(RtMetaData* request, RtMetaData *reply) = 0; 56 57 virtual rt_status setVideoSink(const void *videoSink) = 0; 58 virtual rt_status setAudioSink(const void *audioSink) = 0; 59 virtual rt_status setListener(RTPlayerListener *listener) = 0; 60 }; 61 62 #ifdef __cplusplus 63 } 64 #endif 65 66 #endif // INCLUDE_RT_PLAYER_RTTVPLAYERINTERFACE_H_ 67