1 /*
2 * Copyright (c) 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 #include "test_ndk_screen_capture.h"
17 #include <sync_fence.h>
18 #include "securec.h"
19
20 using namespace std;
21 using namespace OHOS;
22 using namespace OHOS::Media;
23
OnError(OH_AVScreenCapture * screenCapture,int32_t errorCode)24 void TestScreenCaptureNdkCallback::OnError(OH_AVScreenCapture *screenCapture, int32_t errorCode)
25 {
26 cout << "Error received, errorCode: " << errorCode << endl;
27 }
28
OnAudioBufferAvailable(OH_AVScreenCapture * screenCapture,bool isReady,OH_AudioCaptureSourceType type)29 void TestScreenCaptureNdkCallback::OnAudioBufferAvailable(OH_AVScreenCapture *screenCapture, bool isReady,
30 OH_AudioCaptureSourceType type)
31 {
32 cout << "OnAudioBufferAvailable received: " << isReady << ", AudioCaptureSourceType: " << type << endl;
33 }
34
OnVideoBufferAvailable(OH_AVScreenCapture * screenCapture,bool isReady)35 void TestScreenCaptureNdkCallback::OnVideoBufferAvailable(OH_AVScreenCapture *screenCapture, bool isReady)
36 {
37 cout << "OnVideoBufferAvailable received: " << isReady << endl;
38 }
39
TestNdkScreenCapture()40 TestNdkScreenCapture::TestNdkScreenCapture()
41 {
42 }
43
~TestNdkScreenCapture()44 TestNdkScreenCapture::~TestNdkScreenCapture()
45 {
46 }