1 /* GStreamer 2 * Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com> 3 * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef __GST_MF_UTILS_H__ 22 #define __GST_MF_UTILS_H__ 23 24 #include <gst/gst.h> 25 #include <gst/video/video.h> 26 27 #ifndef INITGUID 28 #include <initguid.h> 29 #endif 30 31 #include <windows.h> 32 #include <mfidl.h> 33 #include <mfapi.h> 34 #include <mfreadwrite.h> 35 #include <mferror.h> 36 #include <mfobjects.h> 37 #include <strmif.h> 38 39 G_BEGIN_DECLS 40 41 #define GST_MF_VIDEO_FORMATS \ 42 "{ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420," \ 43 " P010, P016, v210, v216, GRAY16_LE }" 44 45 GstVideoFormat gst_mf_video_subtype_to_video_format (const GUID *subtype); 46 47 const GUID * gst_mf_video_subtype_from_video_format (GstVideoFormat format); 48 49 GstCaps * gst_mf_media_type_to_caps (IMFMediaType * media_type); 50 51 void gst_mf_media_type_release (IMFMediaType * media_type); 52 53 gboolean gst_mf_update_video_info_with_stride (GstVideoInfo * info, 54 gint stride); 55 56 gboolean _gst_mf_result (HRESULT hr, 57 GstDebugCategory * cat, 58 const gchar * file, 59 const gchar * function, 60 gint line); 61 62 #define gst_mf_result(result) \ 63 _gst_mf_result (result, GST_CAT_DEFAULT, __FILE__, GST_FUNCTION, __LINE__) 64 65 void _gst_mf_dump_attributes (IMFAttributes * attr, 66 const gchar * msg, 67 GstDebugLevel level, 68 GstDebugCategory * cat, 69 const gchar * file, 70 const gchar * function, 71 gint line); 72 73 #define gst_mf_dump_attributes(attr,msg,level) \ 74 _gst_mf_dump_attributes (attr, msg, level, GST_CAT_DEFAULT, __FILE__, GST_FUNCTION, __LINE__) 75 76 G_END_DECLS 77 78 #endif /* __GST_MF_UTILS_H__ */