• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2023 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 OHOS_CAMERA_DPS_SESSION_INFO_H
17 #define OHOS_CAMERA_DPS_SESSION_INFO_H
18 
19 #include "ideferred_photo_processing_session_callback.h"
20 #include "deferred_photo_processing_session.h"
21 #include "deferred_photo_processor.h"
22 
23 namespace OHOS {
24 namespace CameraStandard {
25 namespace DeferredProcessing {
26 class SessionManager;
27 
28 class SessionInfo : public RefBase {
29 public:
30     SessionInfo(const int32_t userId, const sptr<IDeferredPhotoProcessingSessionCallback>& callback,
31         SessionManager* sessionManager);
32     virtual ~SessionInfo();
33 
34     sptr<IDeferredPhotoProcessingSession> CreateDeferredPhotoProcessingSession(const int32_t userId,
35         std::shared_ptr<DeferredPhotoProcessor> processor, TaskManager* taskManager,
36         sptr<IDeferredPhotoProcessingSessionCallback> callback);
37     sptr<IDeferredPhotoProcessingSession> GetDeferredPhotoProcessingSession();
38     sptr<IDeferredPhotoProcessingSessionCallback> GetRemoteCallback();
39     void OnCallbackDied();
40     void SetCallback(const sptr<IDeferredPhotoProcessingSessionCallback>& callback);
41 
42 private:
43     class CallbackDeathRecipient;
44     const int32_t userId_;
45     sptr<IDeferredPhotoProcessingSessionCallback> callback_;
46     SessionManager* sessionManager_;
47     sptr<IDeferredPhotoProcessingSession> session_;
48     sptr<CallbackDeathRecipient> callbackDeathRecipient_;
49 };
50 } // namespace DeferredProcessing
51 } // namespace CameraStandard
52 } // namespace OHOS
53 #endif // OHOS_CAMERA_DPS_SESSION_INFO_H