1 // Copyright (C) 2020 The Android Open Source Project
2 //
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 #pragma once
16 
17 #include <cstdint>
18 
19 extern "C" {
20 #include "host-common/dynlink_cuda.h"
21 #include "host-common/dynlink_nvcuvid.h"
22 }
23 #include <stdio.h>
24 #include <string.h>
25 
26 #include <stddef.h>
27 
28 extern "C" {
29 
30 struct media_cuda_utils_copy_context {
31     CUdeviceptr src_frame;
32     unsigned int src_pitch;
33 
34     // this usually >= dest_height due to padding, e.g.
35     // src_surface_height: 1088, dest_height: 1080
36     // so, when copying UV data, the src has to start at
37     // offset = src_pitch * src_surface_height
38     unsigned int src_surface_height;
39 
40     unsigned int dest_width;
41     unsigned int dest_height;
42 };
43 
44 void media_cuda_utils_nv12_updater(void* privData,
45                                    uint32_t type,
46                                    uint32_t* textures,
47                                    void* callerData);
48 }
49