1 /* 2 * Copyright (c) 2023-2024 Shenzhen Kaihong Digital Industry Development 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 OHOS_SHARING_SCREEN_CAPTURE_SESSION_H 17 #define OHOS_SHARING_SCREEN_CAPTURE_SESSION_H 18 19 #include "agent/session/base_session.h" 20 21 namespace OHOS { 22 namespace Sharing { 23 class ScreenCaptureSession : public BaseSession { 24 public: 25 ScreenCaptureSession(); 26 ~ScreenCaptureSession() override; 27 28 int32_t HandleEvent(SharingEvent &event) override; 29 30 void UpdateOperation(SessionStatusMsg::Ptr &statusMsg) override; 31 void UpdateMediaStatus(SessionStatusMsg::Ptr &statusMsg) override; 32 33 protected: 34 void NotifyProsumerInit(SessionStatusMsg::Ptr &statusMsg); 35 void NotifyAgentSessionStatus(SessionStatusMsg::Ptr &statusMsg); 36 37 private: 38 void HandleSessionInit(SharingEvent &event); 39 void HandleProsumerInitState(SharingEvent &event); 40 41 private: 42 uint64_t screenId_ = 0; 43 MediaType captureType_ = MEDIA_TYPE_AV; 44 AudioFormat audioFormat_ = AUDIO_48000_16_2; 45 VideoFormat videoFormat_ = VIDEO_1920X1080_30; 46 }; 47 48 } // namespace Sharing 49 } // namespace OHOS 50 #endif 51