Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
05c99cd6
Commit
05c99cd6
authored
Nov 24, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Dec 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Extract stream name from QT demuxer private data.
parent
3dd56dd6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
media_source.c
dlls/winegstreamer/media_source.c
+1
-0
unixlib.h
dlls/winegstreamer/unixlib.h
+1
-0
wg_parser.c
dlls/winegstreamer/wg_parser.c
+33
-0
No files found.
dlls/winegstreamer/media_source.c
View file @
05c99cd6
...
@@ -1489,6 +1489,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
...
@@ -1489,6 +1489,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
tags
[]
=
tags
[]
=
{
{
{
WG_PARSER_TAG_LANGUAGE
,
&
MF_SD_LANGUAGE
},
{
WG_PARSER_TAG_LANGUAGE
,
&
MF_SD_LANGUAGE
},
{
WG_PARSER_TAG_NAME
,
&
MF_SD_STREAM_NAME
},
};
};
unsigned
int
j
;
unsigned
int
j
;
WCHAR
*
strW
;
WCHAR
*
strW
;
...
...
dlls/winegstreamer/unixlib.h
View file @
05c99cd6
...
@@ -255,6 +255,7 @@ struct wg_parser_stream_get_duration_params
...
@@ -255,6 +255,7 @@ struct wg_parser_stream_get_duration_params
enum
wg_parser_tag
enum
wg_parser_tag
{
{
WG_PARSER_TAG_LANGUAGE
,
WG_PARSER_TAG_LANGUAGE
,
WG_PARSER_TAG_NAME
,
WG_PARSER_TAG_COUNT
WG_PARSER_TAG_COUNT
};
};
...
...
dlls/winegstreamer/wg_parser.c
View file @
05c99cd6
...
@@ -1275,14 +1275,47 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event)
...
@@ -1275,14 +1275,47 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event)
static
void
query_tags
(
struct
wg_parser_stream
*
stream
)
static
void
query_tags
(
struct
wg_parser_stream
*
stream
)
{
{
const
gchar
*
struct_name
;
GstTagList
*
tag_list
;
GstTagList
*
tag_list
;
GstEvent
*
tag_event
;
GstEvent
*
tag_event
;
guint
i
,
tag_count
;
const
GValue
*
val
;
GstSample
*
sample
;
GstBuffer
*
buf
;
gsize
size
;
if
(
!
(
tag_event
=
gst_pad_get_sticky_event
(
stream
->
their_src
,
GST_EVENT_TAG
,
0
)))
if
(
!
(
tag_event
=
gst_pad_get_sticky_event
(
stream
->
their_src
,
GST_EVENT_TAG
,
0
)))
return
;
return
;
gst_event_parse_tag
(
tag_event
,
&
tag_list
);
gst_event_parse_tag
(
tag_event
,
&
tag_list
);
gst_tag_list_get_string
(
tag_list
,
"language-code"
,
&
stream
->
tags
[
WG_PARSER_TAG_LANGUAGE
]);
gst_tag_list_get_string
(
tag_list
,
"language-code"
,
&
stream
->
tags
[
WG_PARSER_TAG_LANGUAGE
]);
/* Extract stream name from Quick Time demuxer private tag where it puts unrecognized chunks. */
tag_count
=
gst_tag_list_get_tag_size
(
tag_list
,
"private-qt-tag"
);
for
(
i
=
0
;
i
<
tag_count
;
++
i
)
{
if
(
!
(
val
=
gst_tag_list_get_value_index
(
tag_list
,
"private-qt-tag"
,
i
)))
continue
;
if
(
!
GST_VALUE_HOLDS_SAMPLE
(
val
)
||
!
(
sample
=
gst_value_get_sample
(
val
)))
continue
;
struct_name
=
gst_structure_get_name
(
gst_sample_get_info
(
sample
));
if
(
!
struct_name
||
strcmp
(
struct_name
,
"application/x-gst-qt-name-tag"
))
continue
;
if
(
!
(
buf
=
gst_sample_get_buffer
(
sample
)))
continue
;
if
((
size
=
gst_buffer_get_size
(
buf
))
<
8
)
continue
;
size
-=
8
;
if
(
!
(
stream
->
tags
[
WG_PARSER_TAG_NAME
]
=
g_malloc
(
size
+
1
)))
continue
;
if
(
gst_buffer_extract
(
buf
,
8
,
stream
->
tags
[
WG_PARSER_TAG_NAME
],
size
)
!=
size
)
{
g_free
(
stream
->
tags
[
WG_PARSER_TAG_NAME
]);
stream
->
tags
[
WG_PARSER_TAG_NAME
]
=
NULL
;
continue
;
}
stream
->
tags
[
WG_PARSER_TAG_NAME
][
size
]
=
0
;
}
gst_event_unref
(
tag_event
);
gst_event_unref
(
tag_event
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment