Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-07-11 12:42:51 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2016-07-11 12:56:46 +0300
commita1f280ecae1f8dc200f8007ba07aeba85f89cc73 (patch)
tree44b1e09d7207606075f8fa6ad20f9e3752511bf3 /common
parentae1f01fedee935731bf3e7c1c0f5844ab03ca6af (diff)
Forward FFMpeg side-data to the decoders
Diffstat (limited to 'common')
-rw-r--r--common/DSUtilLite/DShowUtil.cpp25
-rw-r--r--common/DSUtilLite/DShowUtil.h4
2 files changed, 29 insertions, 0 deletions
diff --git a/common/DSUtilLite/DShowUtil.cpp b/common/DSUtilLite/DShowUtil.cpp
index ffea3fe3..577b1180 100644
--- a/common/DSUtilLite/DShowUtil.cpp
+++ b/common/DSUtilLite/DShowUtil.cpp
@@ -27,6 +27,8 @@
#include "registry.h"
+#include "IMediaSideDataFFmpeg.h"
+
//
// Usage: SetThreadName (-1, "MainThread");
//
@@ -695,6 +697,29 @@ void getExtraData(const BYTE *format, const GUID *formattype, const size_t forma
*extralen = extralength;
}
+void CopyMediaSideDataFF(AVPacket *dst, const MediaSideDataFFMpeg **sd)
+{
+ if (!dst)
+ return;
+
+ if (!sd || !*sd) {
+ dst->side_data = nullptr;
+ dst->side_data_elems = 0;
+ return;
+ }
+
+ // create an empty dummy packet to copy side-data from
+ AVPacket sdPacket = { 0 };
+ av_init_packet(&sdPacket);
+ sdPacket.side_data = (*sd)->side_data;
+ sdPacket.side_data_elems = (*sd)->side_data_elems;
+
+ // copy into the main packet
+ av_copy_packet_side_data(dst, &sdPacket);
+
+ *sd = nullptr;
+}
+
BOOL IsVistaOrNewer()
{
// Query OS version info
diff --git a/common/DSUtilLite/DShowUtil.h b/common/DSUtilLite/DShowUtil.h
index e950d4b0..b7b55541 100644
--- a/common/DSUtilLite/DShowUtil.h
+++ b/common/DSUtilLite/DShowUtil.h
@@ -132,6 +132,10 @@ void audioFormatTypeHandler(const BYTE *format, const GUID *formattype, DWORD *p
void getExtraData(const AM_MEDIA_TYPE &mt, BYTE *extra, size_t *extralen);
void getExtraData(const BYTE *format, const GUID *formattype, const size_t formatlen, BYTE *extra, size_t *extralen);
+struct AVPacket;
+struct MediaSideDataFFMpeg;
+void CopyMediaSideDataFF(AVPacket *dst, const MediaSideDataFFMpeg **sd);
+
BOOL IsVistaOrNewer();
BOOL IsWindows7OrNewer();
BOOL IsWindows8OrNewer();