Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
935211ca
Commit
935211ca
authored
Aug 21, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chroma converter: add CVPixelBuffer to I420 converter
parent
6a06d1f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
0 deletions
+102
-0
modules/video_chroma/Makefile.am
modules/video_chroma/Makefile.am
+5
-0
modules/video_chroma/cvpx_i420.c
modules/video_chroma/cvpx_i420.c
+96
-0
po/POTFILES.in
po/POTFILES.in
+1
-0
No files found.
modules/video_chroma/Makefile.am
View file @
935211ca
...
@@ -116,3 +116,8 @@ chroma_LTLIBRARIES += \
...
@@ -116,3 +116,8 @@ chroma_LTLIBRARIES += \
libd3d11_surface_plugin.la
libd3d11_surface_plugin.la
endif
endif
if
HAVE_DARWIN
libcvpx_i420_plugin_la_SOURCES
=
video_chroma/cvpx_i420.c video_chroma/copy.c video_chroma/copy.h
libcvpx_i420_plugin_la_LDFLAGS
=
$(AM_LDFLAGS)
-rpath
'
$(chromadir)
'
-Wl
,-framework,Foundation
-Wl
,-framework,VideoToolbox
-Wl
,-framework,CoreMedia
-Wl
,-framework,CoreVideo
chroma_LTLIBRARIES
+=
libcvpx_i420_plugin.la
endif
modules/video_chroma/cvpx_i420.c
0 → 100644
View file @
935211ca
/*****************************************************************************
* cvpx_i420.c: core video buffer to picture converter
*****************************************************************************
* Copyright (C) 2015 Videolabs SAS
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QuartzCore/QuartzCore.h>
#include <VideoToolbox/VideoToolbox.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include "copy.h"
struct
picture_sys_t
{
CVPixelBufferRef
pixelBuffer
;
};
static
int
Activate
(
vlc_object_t
*
);
static
void
CVPX_I420
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
static
picture_t
*
CVPX_I420_Filter
(
filter_t
*
,
picture_t
*
);
vlc_module_begin
()
set_description
(
N_
(
"Conversions from CoreVideo buffers to I420"
)
)
set_capability
(
"video filter2"
,
10
)
set_callbacks
(
Activate
,
NULL
)
vlc_module_end
()
static
int
Activate
(
vlc_object_t
*
obj
)
{
filter_t
*
p_filter
=
(
filter_t
*
)
obj
;
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
!=
VLC_CODEC_CVPX_OPAQUE
)
return
VLC_EGENERIC
;
if
(
p_filter
->
fmt_in
.
video
.
i_height
!=
p_filter
->
fmt_out
.
video
.
i_height
||
p_filter
->
fmt_in
.
video
.
i_width
!=
p_filter
->
fmt_out
.
video
.
i_width
)
return
VLC_EGENERIC
;
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_I420
)
return
VLC_EGENERIC
;
p_filter
->
pf_video_filter
=
CVPX_I420_Filter
;
return
VLC_SUCCESS
;
}
VIDEO_FILTER_WRAPPER
(
CVPX_I420
)
static
void
CVPX_I420
(
filter_t
*
p_filter
,
picture_t
*
sourcePicture
,
picture_t
*
destinationPicture
)
{
VLC_UNUSED
(
p_filter
);
picture_sys_t
*
picsys
=
sourcePicture
->
p_sys
;
if
(
picsys
==
NULL
)
return
;
if
(
picsys
->
pixelBuffer
==
nil
)
return
;
uint8_t
*
pp_plane
[
2
];
size_t
pi_pitch
[
2
];
CVPixelBufferLockBaseAddress
(
picsys
->
pixelBuffer
,
0
);
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
pp_plane
[
i
]
=
CVPixelBufferGetBaseAddressOfPlane
(
picsys
->
pixelBuffer
,
i
);
pi_pitch
[
i
]
=
CVPixelBufferGetBytesPerRowOfPlane
(
picsys
->
pixelBuffer
,
i
);
}
CopyFromNv12ToI420
(
destinationPicture
,
pp_plane
,
pi_pitch
,
sourcePicture
->
format
.
i_width
,
sourcePicture
->
format
.
i_height
);
CVPixelBufferUnlockBaseAddress
(
picsys
->
pixelBuffer
,
0
);
}
po/POTFILES.in
View file @
935211ca
...
@@ -1068,6 +1068,7 @@ modules/text_renderer/svg.c
...
@@ -1068,6 +1068,7 @@ modules/text_renderer/svg.c
modules/text_renderer/tdummy.c
modules/text_renderer/tdummy.c
modules/text_renderer/win32text.c
modules/text_renderer/win32text.c
modules/video_chroma/chain.c
modules/video_chroma/chain.c
modules/video_chroma/cvpx_i420.c
modules/video_chroma/d3d11_surface.c
modules/video_chroma/d3d11_surface.c
modules/video_chroma/dxa9.c
modules/video_chroma/dxa9.c
modules/video_chroma/grey_yuv.c
modules/video_chroma/grey_yuv.c
...
...
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