Skip to content

Commit

Permalink
add videotoolbox decoder for OSX/iOS
Browse files Browse the repository at this point in the history
cv buffer life time is different with vda. must increase ref in interop
objects
TODO:
most code are the same as vda. unify these 2 decoders
  • Loading branch information
wang-bin committed Aug 14, 2015
1 parent 6efeb6b commit 8207b2b
Show file tree
Hide file tree
Showing 7 changed files with 489 additions and 2 deletions.
4 changes: 3 additions & 1 deletion QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ unix {
!no-vaapi: OptionalDepends *= vaapi
!no-cedarv: OptionalDepends *= libcedarv
}

mac|ios {
!no-videotoolbox: OptionalDepends *= videotoolbox
}
runConfigTests()
!config_avresample:!config_swresample {
error("libavresample or libswresample is required. Setup your environment correctly then delete $$BUILD_DIR/.qmake.conf and run qmake again")
Expand Down
21 changes: 21 additions & 0 deletions config.tests/videotoolbox/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2015 Wang Bin <[email protected]>
* This file is part of QtAV
This library 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 library 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 library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include <libavcodec/videotoolbox.h>
6 changes: 6 additions & 0 deletions config.tests/videotoolbox/videotoolbox.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG -= qt app_bundle
CONFIG += console

SOURCES += main.cpp

include(../paths.pri)
3 changes: 2 additions & 1 deletion src/QtAV/VideoDecoderTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
VideoRendererTypes: type id and manually id register function
Copyright (C) 2013 Wang Bin <[email protected]>
Copyright (C) 2013-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -40,6 +40,7 @@ extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VAAPI;
extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_Cedarv;
extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_FFmpeg_VDPAU;
extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VDA;
extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VideoToolbox;


Q_AV_EXPORT void VideoDecoder_RegisterAll();
Expand Down
22 changes: 22 additions & 0 deletions src/codec/video/VideoDecoderTypes.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/******************************************************************************
VideoRendererTypes: type id and manually id register function
Copyright (C) 2013-2015 Wang Bin <[email protected]>
* This file is part of QtAV
This library 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 library 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 library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/

#include "QtAV/VideoDecoderTypes.h"
#include "QtAV/FactoryDefine.h"
#include "QtAV/private/mkid.h"
Expand All @@ -10,6 +31,7 @@ VideoDecoderId VideoDecoderId_DXVA = mkid::id32base36_4<'D', 'X', 'V', 'A'>::val
VideoDecoderId VideoDecoderId_VAAPI = mkid::id32base36_5<'V', 'A', 'A', 'P', 'I'>::value;
VideoDecoderId VideoDecoderId_Cedarv = mkid::id32base36_6<'C', 'e', 'd', 'a', 'r', 'V'>::value;
VideoDecoderId VideoDecoderId_VDA = mkid::id32base36_3<'V', 'D', 'A'>::value;
VideoDecoderId VideoDecoderId_VideoToolbox = mkid::id32base36_5<'V', 'T', 'B', 'o', 'x'>::value;

QVector<VideoDecoderId> GetRegistedVideoDecoderIds()
{
Expand Down
Loading

0 comments on commit 8207b2b

Please sign in to comment.