Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
64b80cb0
Commit
64b80cb0
authored
Apr 04, 2020
by
Thilo Borgmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/avfoundation.m: Do not use transport controls for screen capture devices.
parent
3c9185bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
avfoundation.m
libavdevice/avfoundation.m
+11
-9
No files found.
libavdevice/avfoundation.m
View file @
64b80cb0
...
...
@@ -99,6 +99,7 @@ typedef struct
int
capture_raw_data
;
int
drop_late_frames
;
int
video_is_muxed
;
int
video_is_screen
;
int
list_devices
;
int
video_device_index
;
...
...
@@ -545,12 +546,14 @@ static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device)
#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
// check for transport control support and set observer device if supported
int
trans_ctrl
=
[
video_device
transportControlsSupported
];
AVCaptureDeviceTransportControlsPlaybackMode
trans_mode
=
[
video_device
transportControlsPlaybackMode
];
if
(
!
ctx
->
video_is_screen
)
{
int
trans_ctrl
=
[
video_device
transportControlsSupported
];
AVCaptureDeviceTransportControlsPlaybackMode
trans_mode
=
[
video_device
transportControlsPlaybackMode
];
if
(
trans_ctrl
)
{
ctx
->
observed_mode
=
trans_mode
;
ctx
->
observed_device
=
video_device
;
if
(
trans_ctrl
)
{
ctx
->
observed_mode
=
trans_mode
;
ctx
->
observed_device
=
video_device
;
}
}
#endif
...
...
@@ -750,7 +753,6 @@ static int get_audio_config(AVFormatContext *s)
static
int
avf_read_header
(
AVFormatContext
*
s
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
int
capture_screen
=
0
;
uint32_t
num_screens
=
0
;
AVFContext
*
ctx
=
(
AVFContext
*
)
s
->
priv_data
;
AVCaptureDevice
*
video_device
=
nil
;
...
...
@@ -847,7 +849,7 @@ static int avf_read_header(AVFormatContext *s)
}
video_device
=
(
AVCaptureDevice
*
)
capture_screen_input
;
c
apture
_screen
=
1
;
c
tx
->
video_is
_screen
=
1
;
#endif
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid device index
\n
"
);
...
...
@@ -884,7 +886,7 @@ static int avf_read_header(AVFormatContext *s)
AVCaptureScreenInput
*
capture_screen_input
=
[[[
AVCaptureScreenInput
alloc
]
initWithDisplayID
:
screens
[
idx
]]
autorelease
];
video_device
=
(
AVCaptureDevice
*
)
capture_screen_input
;
ctx
->
video_device_index
=
ctx
->
num_video_devices
+
idx
;
c
apture
_screen
=
1
;
c
tx
->
video_is
_screen
=
1
;
if
(
ctx
->
framerate
.
num
>
0
)
{
capture_screen_input
.
minFrameDuration
=
CMTimeMake
(
ctx
->
framerate
.
den
,
ctx
->
framerate
.
num
);
...
...
@@ -975,7 +977,7 @@ static int avf_read_header(AVFormatContext *s)
/* Unlock device configuration only after the session is started so it
* does not reset the capture formats */
if
(
!
c
apture
_screen
)
{
if
(
!
c
tx
->
video_is
_screen
)
{
[
video_device
unlockForConfiguration
];
}
...
...
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