Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
701e5348
Commit
701e5348
authored
Nov 09, 2011
by
Sebastien Zwickert
Committed by
Michael Niedermayer
Nov 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vda: set destination image buffer attributes.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e7062a1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
vda.c
libavcodec/vda.c
+26
-2
vda.h
libavcodec/vda.h
+8
-0
No files found.
libavcodec/vda.c
View file @
701e5348
...
...
@@ -114,7 +114,7 @@ static void vda_decoder_callback (void *vda_hw_ctx,
if
(
NULL
==
image_buffer
)
return
;
if
(
kCVPixelFormatType_422YpCbCr8
!=
CVPixelBufferGetPixelFormatType
(
image_buffer
))
if
(
vda_ctx
->
cv_pix_fmt_type
!=
CVPixelBufferGetPixelFormatType
(
image_buffer
))
return
;
new_frame
=
(
vda_frame
*
)
av_mallocz
(
sizeof
(
vda_frame
));
...
...
@@ -164,6 +164,9 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
CFNumberRef
format
;
CFDataRef
avc_data
;
CFMutableDictionaryRef
config_info
;
CFMutableDictionaryRef
buffer_attributes
;
CFMutableDictionaryRef
io_surface_properties
;
CFNumberRef
cv_pix_fmt
;
if
(
av_lockmgr_register
(
vda_lock_operation
))
return
-
1
;
...
...
@@ -185,8 +188,26 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
CFDictionarySetValue
(
config_info
,
kVDADecoderConfiguration_SourceFormat
,
format
);
CFDictionarySetValue
(
config_info
,
kVDADecoderConfiguration_avcCData
,
avc_data
);
buffer_attributes
=
(
CFDictionaryCreateMutable
(
kCFAllocatorDefault
,
2
,
&
kCFTypeDictionaryKeyCallBacks
,
&
kCFTypeDictionaryValueCallBacks
));
io_surface_properties
=
(
CFDictionaryCreateMutable
(
kCFAllocatorDefault
,
0
,
&
kCFTypeDictionaryKeyCallBacks
,
&
kCFTypeDictionaryValueCallBacks
));
cv_pix_fmt
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
vda_ctx
->
cv_pix_fmt_type
);
CFDictionarySetValue
(
buffer_attributes
,
kCVPixelBufferPixelFormatTypeKey
,
cv_pix_fmt
);
CFDictionarySetValue
(
buffer_attributes
,
kCVPixelBufferIOSurfacePropertiesKey
,
io_surface_properties
);
status
=
VDADecoderCreate
(
config_info
,
NULL
,
buffer_attributes
,
(
VDADecoderOutputCallback
*
)
vda_decoder_callback
,
(
void
*
)
vda_ctx
,
&
vda_ctx
->
decoder
);
...
...
@@ -196,6 +217,9 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
CFRelease
(
format
);
CFRelease
(
avc_data
);
CFRelease
(
config_info
);
CFRelease
(
io_surface_properties
);
CFRelease
(
cv_pix_fmt
);
CFRelease
(
buffer_attributes
);
if
(
kVDADecoderNoErr
!=
status
)
return
status
;
...
...
libavcodec/vda.h
View file @
701e5348
...
...
@@ -121,6 +121,14 @@ struct vda_context {
* - decoding: Set/Unset by user.
*/
int
format
;
/**
* The pixel format for output image buffers.
*
* - encoding: unused
* - decoding: Set/Unset by user.
*/
OSType
cv_pix_fmt_type
;
};
/** Creates the video decoder. */
...
...
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