1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef I_LPP_VIDEO_PLAYER_SERVICE_H 17 #define I_LPP_VIDEO_PLAYER_SERVICE_H 18 19 #include "lpp_video_streamer.h" 20 #include "refbase.h" 21 #include "lpp_common.h" 22 23 namespace OHOS { 24 namespace Media { 25 class ILppVideoStreamerService { 26 public: 27 virtual ~ILppVideoStreamerService() = default; 28 29 // virtual int32_t SetSource(const std::string &url) = 0; 30 31 virtual int32_t Init(const std::string &mime) = 0; 32 33 virtual int32_t SetParameter(const Format ¶m) = 0; 34 35 virtual int32_t Configure(const Format ¶m) = 0; 36 37 virtual int32_t Prepare() = 0; 38 39 virtual int32_t Start() = 0; 40 41 virtual int32_t Pause() = 0; 42 43 virtual int32_t Resume() = 0; 44 45 virtual int32_t Flush() = 0; 46 47 virtual int32_t Stop() = 0; 48 49 virtual int32_t Reset() = 0; 50 51 virtual int32_t Release() = 0; 52 53 virtual int32_t StartDecode() = 0; 54 55 virtual int32_t StartRender() = 0; 56 57 virtual int32_t SetOutputSurface(sptr<Surface> surface) = 0; 58 59 virtual int32_t SetSyncAudioStreamer(AudioStreamer *audioStreamer) = 0; 60 61 virtual int32_t SetTargetStartFrame(const int64_t targetPts, const int timeoutMs) = 0; 62 63 virtual int32_t SetVolume(float volume) = 0; 64 65 virtual int32_t SetPlaybackSpeed(float speed) = 0; 66 67 virtual int32_t ReturnFrames(sptr<LppDataPacket> framePacket) = 0; 68 69 virtual int32_t RegisterCallback() = 0; 70 71 virtual int32_t SetLppVideoStreamerCallback(const std::shared_ptr<VideoStreamerCallback> &callback) = 0; 72 73 virtual int32_t SetLppAudioStreamerId(const std::string audioStreamId) = 0; 74 75 virtual std::string GetStreamerId() = 0; 76 77 virtual int32_t RenderFirstFrame() = 0; 78 }; 79 } // namespace Media 80 } // namespace OHOS 81 #endif // I_LPP_VIDEO_PLAYER_SERVICE_H 82