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 /** 17 * @addtogroup AVImageGenerator 18 * @{ 19 * 20 * @brief Provides APIs for generating an image at the specific time from a video resource. 21 * 22 * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 23 * @since 16 24 */ 25 26 /** 27 * @file avimage_generator_base.h 28 * 29 * @brief Defines the structure and enumeration for AVImageGenerator. 30 * 31 * @kit MediaKit 32 * @library libavimage_generator.so 33 * @since 16 34 */ 35 36 #ifndef MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVIMAGE_GENERATOR_BASE_H 37 #define MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVIMAGE_GENERATOR_BASE_H 38 39 #include <stdint.h> 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 /** 46 * @brief Enumerates the image query options about the relationship between the given timeUs and a key frame. 47 * 48 * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 49 * @since 16 50 */ 51 typedef enum OH_AVImageGenerator_QueryOptions { 52 /** 53 * This option is used to fetch a key frame from the given media 54 * resource that is located right after or at the given time. 55 */ 56 OH_AVIMAGE_GENERATOR_QUERY_NEXT_SYNC = 0, 57 /** 58 * This option is used to fetch a key frame from the given media 59 * resource that is located right before or at the given time. 60 */ 61 OH_AVIMAGE_GENERATOR_QUERY_PREVIOUS_SYNC = 1, 62 /** 63 * This option is used to fetch a key frame from the given media 64 * resource that is located closest to or at the given time. 65 */ 66 OH_AVIMAGE_GENERATOR_QUERY_CLOSEST_SYNC = 2, 67 /** 68 * This option is used to fetch a frame (maybe not keyframe) from 69 * the given media resource that is located closest to or at the given time. 70 */ 71 OH_AVIMAGE_GENERATOR_QUERY_CLOSEST = 3, 72 } OH_AVImageGenerator_QueryOptions; 73 74 #ifdef __cplusplus 75 } 76 #endif 77 #endif // MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVMETADATA_EXTRACTOR_BASE_H