├── .gitignore ├── DJIWidget ├── DJIWidget.xcodeproj │ └── project.pbxproj ├── DJIWidget │ ├── DJISymbols.h │ ├── DJIWidget.h │ ├── DJIWidgetPrefix.pch │ ├── Info.plist │ ├── RTMPProcessor │ │ ├── DJIAudioSampleBuffer.h │ │ ├── DJIAudioSampleBuffer.m │ │ ├── DJIRtmpIFrameProvider.h │ │ ├── DJIRtmpIFrameProvider.m │ │ ├── DJIRtmpMuxer.h │ │ ├── DJIRtmpMuxer.m │ │ ├── DJIVideoPreviewSmoothHelper.h │ │ └── DJIVideoPreviewSmoothHelper.m │ ├── VideoLiveCamera │ │ ├── DJILiveViewDammyCameraSessionProtocol.h │ │ ├── DJILiveViewDammyCameraStructs.h │ │ ├── RecordVideo │ │ │ ├── DJIVideoFeedCachingSession.h │ │ │ ├── DJIVideoFeedCachingSession.m │ │ │ └── VideoWriter │ │ │ │ ├── Context │ │ │ │ ├── DJIVideoFrameSyncPoint.h │ │ │ │ ├── DJIVideoFrameSyncPoint.m │ │ │ │ ├── DJIVideoWriterContext.h │ │ │ │ ├── DJIVideoWriterContext.m │ │ │ │ └── Muxer │ │ │ │ │ ├── DJIVideoPoolMp4Muxer.h │ │ │ │ │ ├── DJIVideoPoolMp4Muxer.m │ │ │ │ │ ├── djiffremux.c │ │ │ │ │ └── djiffremux.h │ │ │ │ ├── DJIVideoWriter.h │ │ │ │ ├── DJIVideoWriter.m │ │ │ │ ├── DJIVideoWriterDiskHelper.h │ │ │ │ └── DJIVideoWriterDiskHelper.m │ │ └── ShootPhoto │ │ │ ├── DJIAlbumHandler.h │ │ │ ├── DJIAlbumHandler.m │ │ │ ├── DJILiveViewDammyCameraTakePhotoSession.h │ │ │ └── DJILiveViewDammyCameraTakePhotoSession.m │ ├── VideoPreviewer │ │ ├── DJIAlbumTransfer.h │ │ ├── DJIAlbumTransfer.m │ │ ├── DJICustomVideoFrameExtractor.h │ │ ├── DJICustomVideoFrameExtractor.m │ │ ├── DJIDecodeFrameRateMonitor.h │ │ ├── DJIDecodeFrameRateMonitor.m │ │ ├── DJIH264VTDecode.h │ │ ├── DJIH264VTDecode.m │ │ ├── DJIJpegStreamImageDecoder.h │ │ ├── DJIJpegStreamImageDecoder.m │ │ ├── DJIMovieGLView.h │ │ ├── DJIMovieGLView.m │ │ ├── DJISmoothDecode.h │ │ ├── DJISoftwareDecodeProcessor.h │ │ ├── DJISoftwareDecodeProcessor.m │ │ ├── DJIStreamCommon.h │ │ ├── DJIStreamCommon.m │ │ ├── DJIVideoHelper.h │ │ ├── DJIVideoHelper.m │ │ ├── DJIVideoPoolStructs.h │ │ ├── DJIVideoPreviewer.h │ │ ├── DJIVideoPreviewer.m │ │ ├── H264Parser │ │ │ ├── DJIVideoPreviewerH264Parser.h │ │ │ └── DJIVideoPreviewerH264Parser.m │ │ ├── Helper │ │ │ ├── DJIH264FrameRawLayerDumper.h │ │ │ ├── DJIH264FrameRawLayerDumper.m │ │ │ ├── DJIH264PocQueue.h │ │ │ ├── DJIH264PocQueue.m │ │ │ ├── DJIImageCache │ │ │ │ ├── DJIImageCache.h │ │ │ │ ├── DJIImageCache.m │ │ │ │ ├── DJIImageCacheQueue.h │ │ │ │ ├── DJIImageCacheQueue.m │ │ │ │ ├── DJIPixelCache.h │ │ │ │ └── DJIPixelCache.m │ │ │ ├── DJIImageCalibrateHelper.h │ │ │ ├── DJIImageCalibrateHelper.m │ │ │ ├── DJIImageCalibrateHelper_Private.h │ │ │ ├── DJIImageCalibrationFrame │ │ │ │ ├── DJIImageCalibrationFastFrame.h │ │ │ │ ├── DJIImageCalibrationFastFrame.m │ │ │ │ ├── DJIImageCalibrationFastFrame_Private.h │ │ │ │ ├── DJIImageCalibrationFrame.h │ │ │ │ ├── DJIImageCalibrationFrame.m │ │ │ │ ├── DJIImageCalibrationFrameQueue.h │ │ │ │ └── DJIImageCalibrationFrameQueue.m │ │ │ ├── DJIVideoPresentViewAdjustHelper.h │ │ │ ├── DJIVideoPresentViewAdjustHelper.m │ │ │ └── ImageCalibrate │ │ │ │ ├── DJIDecodeImageCalibrateDataBuffer.h │ │ │ │ ├── DJIDecodeImageCalibrateDataBuffer.m │ │ │ │ ├── DJIDecodeImageCalibrateDataSource.h │ │ │ │ ├── DJIDecodeImageCalibrateDataSource.m │ │ │ │ ├── DJIDecodeImageCalibrateHelper.h │ │ │ │ ├── DJIDecodeImageCalibrateHelper.m │ │ │ │ ├── DJIImageCalibrateColorCPUConverter.h │ │ │ │ ├── DJIImageCalibrateColorCPUConverter.m │ │ │ │ ├── DJIImageCalibrateColorConverter.h │ │ │ │ ├── DJIImageCalibrateColorConverter.m │ │ │ │ ├── DJIImageCalibrateColorConverter_Private.h │ │ │ │ ├── DJIImageCalibrateColorGPUConverter.h │ │ │ │ ├── DJIImageCalibrateColorGPUConverter.m │ │ │ │ ├── DJIImageCalibrateFilterDataSource.h │ │ │ │ ├── DJIImageCalibrateFilterDataSource.m │ │ │ │ ├── DJIMavic2ProCameraImageCalibrateFilterDataSource.h │ │ │ │ ├── DJIMavic2ProCameraImageCalibrateFilterDataSource.m │ │ │ │ ├── DJIMavic2ZoomCameraImageCalibrateFilterDataSource.h │ │ │ │ ├── DJIMavic2ZoomCameraImageCalibrateFilterDataSource.m │ │ │ │ ├── Holder │ │ │ │ ├── DJIImageCalibrateHelperHolder.h │ │ │ │ └── DJIImageCalibrateHelperHolder.m │ │ │ │ └── PixelBufferProvider │ │ │ │ ├── DJICalibratePixelBufferProvider.h │ │ │ │ └── DJICalibratePixelBufferProvider.m │ │ ├── Lb2AUD │ │ │ ├── DJILB2AUDRemoveParser.h │ │ │ └── DJILB2AUDRemoveParser.m │ │ └── Render │ │ │ ├── Base │ │ │ ├── DJILiveViewFrameBuffer.h │ │ │ ├── DJILiveViewFrameBuffer.m │ │ │ ├── DJILiveViewFrameBuffer_Private.h │ │ │ ├── DJILiveViewRenderCommon.h │ │ │ ├── DJILiveViewRenderCommon.m │ │ │ ├── DJILiveViewRenderContext.h │ │ │ ├── DJILiveViewRenderContext.m │ │ │ ├── DJILiveViewRenderDisplayView.h │ │ │ ├── DJILiveViewRenderDisplayView.m │ │ │ ├── DJILiveViewRenderFilter.h │ │ │ ├── DJILiveViewRenderFilter.m │ │ │ ├── DJILiveViewRenderPass.h │ │ │ ├── DJILiveViewRenderPass.m │ │ │ ├── DJILiveViewRenderProgram.h │ │ │ └── DJILiveViewRenderProgram.m │ │ │ ├── CalibrateFilter │ │ │ ├── DJILiveViewCalibrateFilter.h │ │ │ └── DJILiveViewCalibrateFilter.m │ │ │ ├── ColorMatrixFilter │ │ │ ├── DJILiveViewRenderColorMatrixFilter.h │ │ │ └── DJILiveViewRenderColorMatrixFilter.m │ │ │ ├── ColorMonitor │ │ │ ├── DJILiveViewColorMonitorFilter.h │ │ │ └── DJILiveViewColorMonitorFilter.m │ │ │ ├── ColorSpaceFilter │ │ │ ├── DJILiveViewColorSpaceFilter.h │ │ │ └── DJILiveViewColorSpaceFilter.m │ │ │ ├── HSBFilter │ │ │ ├── DJILiveViewRenderHSBFilter.h │ │ │ └── DJILiveViewRenderHSBFilter.m │ │ │ ├── HighLightShadowFilter │ │ │ ├── DJILiveViewRenderHighlightShadowFilter.h │ │ │ └── DJILiveViewRenderHighlightShadowFilter.m │ │ │ ├── LookupFilter │ │ │ ├── DJILiveViewRenderLookupFilter.h │ │ │ └── DJILiveViewRenderLookupFilter.m │ │ │ ├── ReversDLogLookup │ │ │ ├── DJIReverseDLogFilter.h │ │ │ └── DJIReverseDLogFilter.m │ │ │ ├── ScaleFilter │ │ │ ├── DJILiveViewRenderScaleFilter.h │ │ │ └── DJILiveViewRenderScaleFilter.m │ │ │ ├── SobelFilter │ │ │ ├── DJILiveViewRenderFocusWarningFilter.h │ │ │ └── DJILiveViewRenderFocusWarningFilter.m │ │ │ ├── Texture │ │ │ ├── DJILiveViewRenderPicutre.h │ │ │ ├── DJILiveViewRenderPicutre.m │ │ │ ├── DJILiveViewRenderTexture.h │ │ │ └── DJILiveViewRenderTexture.m │ │ │ └── Upload │ │ │ ├── DJILiveViewRenderDataSource.h │ │ │ ├── DJILiveViewRenderDataSource.m │ │ │ └── DJILiveViewRenderDataSource_Private.h │ └── VideoService │ │ ├── DJIVTH264DecoderIFrameData.h │ │ ├── DJIVTH264DecoderIFrameData.m │ │ ├── DJIWidgetAsyncCommandQueue.h │ │ ├── DJIWidgetAsyncCommandQueue.m │ │ ├── DJIWidgetLinkQueue.h │ │ ├── DJIWidgetLinkQueue.m │ │ ├── DJIWidgetMacros.h │ │ ├── H1Camera │ │ ├── DJICameraRemotePlayerView.h │ │ ├── DJICameraRemotePlayerView.m │ │ ├── DJIRTPlayerRenderView.h │ │ └── DJIRTPlayerRenderView.m │ │ └── VTH264Encoder │ │ ├── DJIVTH264CompressConfiguration.h │ │ ├── DJIVTH264CompressConfiguration.m │ │ ├── DJIVTH264CompressSession.h │ │ ├── DJIVTH264CompressSession.m │ │ ├── DJIVTH264Compressor.h │ │ ├── DJIVTH264Compressor.m │ │ ├── DJIVTH264Encoder.h │ │ ├── DJIVTH264Encoder.m │ │ ├── NSError+DJIVTH264CompressSession.h │ │ └── NSError+DJIVTH264CompressSession.m └── FFmpeg │ └── FFmpeg.framework │ ├── FFmpeg │ ├── Headers │ ├── FFmpeg.h │ ├── libavcodec │ │ ├── avcodec.h │ │ ├── avfft.h │ │ ├── dv_profile.h │ │ ├── dxva2.h │ │ ├── old_codec_ids.h │ │ ├── vaapi.h │ │ ├── vda.h │ │ ├── vdpau.h │ │ ├── version.h │ │ ├── vorbis_parser.h │ │ └── xvmc.h │ ├── libavdevice │ │ ├── avdevice.h │ │ └── version.h │ ├── libavfilter │ │ ├── asrc_abuffer.h │ │ ├── avcodec.h │ │ ├── avfilter.h │ │ ├── avfiltergraph.h │ │ ├── buffersink.h │ │ ├── buffersrc.h │ │ └── version.h │ ├── libavformat │ │ ├── avformat.h │ │ ├── avio.h │ │ └── version.h │ ├── libavresample │ │ ├── avresample.h │ │ └── version.h │ ├── libavutil │ │ ├── adler32.h │ │ ├── aes.h │ │ ├── attributes.h │ │ ├── audio_fifo.h │ │ ├── audioconvert.h │ │ ├── avassert.h │ │ ├── avconfig.h │ │ ├── avstring.h │ │ ├── avutil.h │ │ ├── base64.h │ │ ├── blowfish.h │ │ ├── bprint.h │ │ ├── bswap.h │ │ ├── buffer.h │ │ ├── cast5.h │ │ ├── channel_layout.h │ │ ├── common.h │ │ ├── cpu.h │ │ ├── crc.h │ │ ├── dict.h │ │ ├── display.h │ │ ├── downmix_info.h │ │ ├── error.h │ │ ├── eval.h │ │ ├── ffversion.h │ │ ├── fifo.h │ │ ├── file.h │ │ ├── frame.h │ │ ├── hash.h │ │ ├── hmac.h │ │ ├── imgutils.h │ │ ├── intfloat.h │ │ ├── intreadwrite.h │ │ ├── lfg.h │ │ ├── log.h │ │ ├── macros.h │ │ ├── mathematics.h │ │ ├── md5.h │ │ ├── mem.h │ │ ├── motion_vector.h │ │ ├── murmur3.h │ │ ├── old_pix_fmts.h │ │ ├── opt.h │ │ ├── parseutils.h │ │ ├── pixdesc.h │ │ ├── pixelutils.h │ │ ├── pixfmt.h │ │ ├── random_seed.h │ │ ├── rational.h │ │ ├── replaygain.h │ │ ├── ripemd.h │ │ ├── samplefmt.h │ │ ├── sha.h │ │ ├── sha512.h │ │ ├── stereo3d.h │ │ ├── threadmessage.h │ │ ├── time.h │ │ ├── timecode.h │ │ ├── timestamp.h │ │ ├── version.h │ │ └── xtea.h │ ├── libswresample │ │ ├── swresample.h │ │ └── version.h │ └── libswscale │ │ ├── swscale.h │ │ └── version.h │ ├── Info.plist │ ├── Modules │ └── module.modulemap │ └── strip-frameworks.sh ├── LICENSE ├── PanoDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── PanoDemo.xccheckout │ │ └── PanoDemo.xcscmblueprint │ └── xcuserdata │ │ ├── DJI_Oliver.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── edeline.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings │ │ ├── zefei.li.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── zlinoliver.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── DJI_Oliver.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── PanoDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── edeline.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── PanoDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── zefei.li.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── PanoDemo.xcscheme │ │ └── xcschememanagement.plist │ └── zlinoliver.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── PanoDemo.xcscheme │ └── xcschememanagement.plist ├── PanoDemo ├── AppDelegate.h ├── AppDelegate.mm ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── CaptureViewController.h ├── CaptureViewController.m ├── Frameworks │ └── opencv2.framework │ │ ├── Headers │ │ ├── Resources │ │ ├── Versions │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── calib3d │ │ │ │ │ └── calib3d.hpp │ │ │ │ ├── contrib │ │ │ │ │ ├── contrib.hpp │ │ │ │ │ ├── detection_based_tracker.hpp │ │ │ │ │ ├── hybridtracker.hpp │ │ │ │ │ ├── openfabmap.hpp │ │ │ │ │ └── retina.hpp │ │ │ │ ├── core │ │ │ │ │ ├── affine.hpp │ │ │ │ │ ├── core.hpp │ │ │ │ │ ├── core_c.h │ │ │ │ │ ├── cuda_devptrs.hpp │ │ │ │ │ ├── devmem2d.hpp │ │ │ │ │ ├── eigen.hpp │ │ │ │ │ ├── gpumat.hpp │ │ │ │ │ ├── internal.hpp │ │ │ │ │ ├── mat.hpp │ │ │ │ │ ├── opengl_interop.hpp │ │ │ │ │ ├── opengl_interop_deprecated.hpp │ │ │ │ │ ├── operations.hpp │ │ │ │ │ ├── types_c.h │ │ │ │ │ ├── version.hpp │ │ │ │ │ └── wimage.hpp │ │ │ │ ├── features2d │ │ │ │ │ └── features2d.hpp │ │ │ │ ├── flann │ │ │ │ │ ├── all_indices.h │ │ │ │ │ ├── allocator.h │ │ │ │ │ ├── any.h │ │ │ │ │ ├── autotuned_index.h │ │ │ │ │ ├── composite_index.h │ │ │ │ │ ├── config.h │ │ │ │ │ ├── defines.h │ │ │ │ │ ├── dist.h │ │ │ │ │ ├── dummy.h │ │ │ │ │ ├── dynamic_bitset.h │ │ │ │ │ ├── flann.hpp │ │ │ │ │ ├── flann_base.hpp │ │ │ │ │ ├── general.h │ │ │ │ │ ├── ground_truth.h │ │ │ │ │ ├── hdf5.h │ │ │ │ │ ├── heap.h │ │ │ │ │ ├── hierarchical_clustering_index.h │ │ │ │ │ ├── index_testing.h │ │ │ │ │ ├── kdtree_index.h │ │ │ │ │ ├── kdtree_single_index.h │ │ │ │ │ ├── kmeans_index.h │ │ │ │ │ ├── linear_index.h │ │ │ │ │ ├── logger.h │ │ │ │ │ ├── lsh_index.h │ │ │ │ │ ├── lsh_table.h │ │ │ │ │ ├── matrix.h │ │ │ │ │ ├── miniflann.hpp │ │ │ │ │ ├── nn_index.h │ │ │ │ │ ├── object_factory.h │ │ │ │ │ ├── params.h │ │ │ │ │ ├── random.h │ │ │ │ │ ├── result_set.h │ │ │ │ │ ├── sampling.h │ │ │ │ │ ├── saving.h │ │ │ │ │ ├── simplex_downhill.h │ │ │ │ │ └── timer.h │ │ │ │ ├── highgui │ │ │ │ │ ├── cap_ios.h │ │ │ │ │ ├── highgui.hpp │ │ │ │ │ ├── highgui_c.h │ │ │ │ │ └── ios.h │ │ │ │ ├── imgproc │ │ │ │ │ ├── imgproc.hpp │ │ │ │ │ ├── imgproc_c.h │ │ │ │ │ └── types_c.h │ │ │ │ ├── legacy │ │ │ │ │ ├── blobtrack.hpp │ │ │ │ │ ├── compat.hpp │ │ │ │ │ ├── legacy.hpp │ │ │ │ │ └── streams.hpp │ │ │ │ ├── ml │ │ │ │ │ └── ml.hpp │ │ │ │ ├── nonfree │ │ │ │ │ ├── features2d.hpp │ │ │ │ │ ├── gpu.hpp │ │ │ │ │ ├── nonfree.hpp │ │ │ │ │ └── ocl.hpp │ │ │ │ ├── objdetect │ │ │ │ │ └── objdetect.hpp │ │ │ │ ├── opencv.hpp │ │ │ │ ├── opencv_modules.hpp │ │ │ │ ├── photo │ │ │ │ │ ├── photo.hpp │ │ │ │ │ └── photo_c.h │ │ │ │ ├── stitching │ │ │ │ │ ├── detail │ │ │ │ │ │ ├── autocalib.hpp │ │ │ │ │ │ ├── blenders.hpp │ │ │ │ │ │ ├── camera.hpp │ │ │ │ │ │ ├── exposure_compensate.hpp │ │ │ │ │ │ ├── matchers.hpp │ │ │ │ │ │ ├── motion_estimators.hpp │ │ │ │ │ │ ├── seam_finders.hpp │ │ │ │ │ │ ├── util.hpp │ │ │ │ │ │ ├── util_inl.hpp │ │ │ │ │ │ ├── warpers.hpp │ │ │ │ │ │ └── warpers_inl.hpp │ │ │ │ │ ├── stitcher.hpp │ │ │ │ │ └── warpers.hpp │ │ │ │ ├── video │ │ │ │ │ ├── background_segm.hpp │ │ │ │ │ ├── tracking.hpp │ │ │ │ │ └── video.hpp │ │ │ │ ├── videostab │ │ │ │ │ ├── deblurring.hpp │ │ │ │ │ ├── fast_marching.hpp │ │ │ │ │ ├── fast_marching_inl.hpp │ │ │ │ │ ├── frame_source.hpp │ │ │ │ │ ├── global_motion.hpp │ │ │ │ │ ├── inpainting.hpp │ │ │ │ │ ├── log.hpp │ │ │ │ │ ├── motion_stabilizing.hpp │ │ │ │ │ ├── optical_flow.hpp │ │ │ │ │ ├── stabilizer.hpp │ │ │ │ │ └── videostab.hpp │ │ │ │ └── world │ │ │ │ │ └── world.hpp │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── opencv2 │ │ └── Current │ │ └── opencv2 ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon_120*120.png │ │ ├── Icon_152*152.png │ │ ├── Icon_180*180.png │ │ └── Icon_76*76.png │ └── btn.imageset │ │ ├── Contents.json │ │ └── btn.png ├── Info.plist ├── Models │ ├── Cropping.h │ ├── Cropping.mm │ ├── OpenCVConversion.h │ ├── OpenCVConversion.mm │ ├── Stitching.h │ ├── Stitching.mm │ ├── StitchingWrapper.cpp │ └── StitchingWrapper.h ├── PrefixHeader.pch ├── StitchingViewController.h ├── StitchingViewController.mm └── main.m ├── PanoDemoTests ├── Info.plist └── PanoDemoTests.m ├── Podfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | .DS_Store 5 | 6 | ## Build generated 7 | build/ 8 | DerivedData 9 | Pods/ 10 | Podfile.lock 11 | 12 | ## Various settings 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | xcuserdata 22 | 23 | ## Other 24 | *.xccheckout 25 | *.moved-aside 26 | *.xcuserstate 27 | *.xcscmblueprint 28 | Podfile.lock 29 | 30 | *.xcworkspace 31 | 32 | ## Obj-C/Swift specific 33 | *.hmap 34 | *.ipa 35 | *.xcworkspace 36 | 37 | # CocoaPods 38 | # 39 | # We recommend against adding the Pods directory to your .gitignore. However 40 | # you should judge for yourself, the pros and cons are mentioned at: 41 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 42 | # 43 | #Pods/ 44 | 45 | # Carthage 46 | # 47 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 48 | # Carthage/Checkouts 49 | 50 | Carthage/Build 51 | 52 | build 53 | Output 54 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/DJISymbols.h: -------------------------------------------------------------------------------- 1 | // djisymbols.h 2 | 3 | #ifndef DJI_OBF_STRING 4 | #define STR1(R) #R 5 | #define STR2(R) STR1(R) 6 | #define DJI_OBF_STRING(_ARG_) [NSString stringWithUTF8String:STR2(_ARG_)] 7 | #endif 8 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/DJIWidgetPrefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/RTMPProcessor/DJIAudioSampleBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIAudioSampleBuffer.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | 10 | @interface DJIAudioSampleBuffer : NSObject 11 | -(id) init; 12 | -(void) audioBufferPush:(const short *)audio count:(int)num_samples; 13 | -(int) audioBufferSize; 14 | -(void) audioBufferPop:(int)num_samples; 15 | -(float*) audioBufferGet; 16 | -(void) audioBufferClear; 17 | @end 18 | 19 | @interface DJIP3AudioByteBuffer : NSObject 20 | -(id) init; 21 | -(int) audioBufferPush:(const uint8_t *)audio count:(int)num_samples; 22 | -(int) audioBufferPushFloat:(Float32*)sample count:(int)num_samples; 23 | -(int) audioBufferPushFloat:(Float32**)channels channel:(int)channel sampleCount:(int)num_sample; 24 | -(int) audioBufferSize; 25 | -(void) audioBufferPop:(int)bytes; 26 | -(uint8_t*) audioBufferGet; 27 | -(void) audioBufferClear; 28 | @end 29 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/RTMPProcessor/DJIRtmpIFrameProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIIFrameProvider.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | 10 | typedef NS_ENUM(NSUInteger, DJIRtmpIFrameProviderStatus) { 11 | DJIRtmpIFrameProviderStatusNotStartYet, // not yet started creating an iframe 12 | DJIRtmpIFrameProviderStatusProcessing, // processing iframes 13 | DJIRtmpIFrameProviderStatusFinish, // processing frame is completed 14 | }; 15 | 16 | 17 | /* 18 | This class is used to read the iframe coded by the encoder and save it, provided to ffmpeg to create codec_context for live streaming 19 | */ 20 | 21 | @interface DJIRtmpIFrameProvider : NSObject 22 | 23 | @property (nonatomic, assign, readonly) DJIRtmpIFrameProviderStatus status; 24 | 25 | @property (nonatomic, strong, readonly) NSData* extraData; // sps and pps information 26 | 27 | - (void)processFrame:(VideoFrameH264Raw *)frame sps:(NSData *)sps pps:(NSData *)pps; 28 | 29 | - (NSString *)iFrameFilePath; 30 | 31 | - (void)reset; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/RTMPProcessor/DJIVideoPreviewSmoothHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoPreviewSmoothHelper.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | 10 | // Given a delay time, control the overall delay through sleep in the loop of the frame processing to achieve a smooth effect 11 | @interface DJIVideoPreviewSmoothHelper : NSObject 12 | 13 | /* 14 | * ms precision time 15 | */ 16 | +(double) getTick; 17 | 18 | /* 19 | * number of cached frames 20 | */ 21 | -(double) frameBuffered; 22 | 23 | /* 24 | * decode loop input 25 | */ 26 | -(double) sleepTimeForCurrentFrame:(double)currentTime framePushInQueueTime:(double)inQueueTime decodeCostTime:(double)decodeTime; 27 | 28 | /* 29 | * reset smoothing 30 | */ 31 | -(void) resetSmooth; 32 | 33 | /* 34 | * enter the desired frame interval (s) 35 | */ 36 | @property (nonatomic, assign) double requiredFrameDelta; 37 | 38 | /* 39 | * enter the desired delay(s) 40 | */ 41 | @property (nonatomic, assign) double requiredDelay; 42 | 43 | /* 44 | * The upper limit of the delay, for example, the limit 100ms is required. If the delay exceeds 100ms, 0delay is directly output. 45 | */ 46 | @property (nonatomic, assign) double delayUpperLimits; 47 | @end 48 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/DJILiveViewDammyCameraSessionProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewDammyCameraProtocol.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJILiveViewDammyCameraStructs.h" 9 | 10 | @protocol DJILiveViewDammyCameraSessionProtocol 11 | 12 | -(BOOL) startSession; 13 | 14 | -(BOOL) stopSession; 15 | 16 | @optional 17 | @property (nonatomic, readonly) DJILiveViewDammyCameraRecordingStatus recordingStatus; 18 | @property (nonatomic, readonly) NSTimeInterval recordedTime; 19 | 20 | @property (nonatomic, readonly) DJILiveViewDammyCameraCaptureStatus captureStatus; 21 | @end 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/DJILiveViewDammyCameraStructs.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewDammyCameraStructs.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #ifndef DJILiveViewDammyCameraStructs_h 8 | #define DJILiveViewDammyCameraStructs_h 9 | 10 | typedef enum : NSUInteger { 11 | DJILiveViewDammyCameraWorkModeOff, //user disabled 12 | DJILiveViewDammyCameraWorkModeCapture, //ready to take photo 13 | DJILiveViewDammyCameraWorkModeRecording, //ready to record video 14 | DJILiveViewDammyCameraWorkModeQuickmovie, //ready to record quickmovie 15 | } DJILiveViewDammyCameraWorkMode; 16 | 17 | typedef enum : NSUInteger { 18 | DJILiveViewDammyCameraCaptureStatusNone, 19 | DJILiveViewDammyCameraCaptureStatusCapturing, 20 | DJILiveViewDammyCameraCaptureStatusEnded, //ended, internal use 21 | } DJILiveViewDammyCameraCaptureStatus; 22 | 23 | typedef enum : NSUInteger { 24 | DJILiveViewDammyCameraRecordingStatusNone, 25 | DJILiveViewDammyCameraRecordingStatusPrepear, 26 | DJILiveViewDammyCameraRecordingStatusRecording, 27 | DJILiveViewDammyCameraRecordingStatusEnded, //ended, internal use 28 | } DJILiveViewDammyCameraRecordingStatus; 29 | 30 | 31 | #endif /* DJILiveViewDammyCameraStructs_h */ 32 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/DJIVideoFeedCachingSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoFeedCachingSession.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJILiveViewDammyCameraSessionProtocol.h" 9 | 10 | @class DJIVideoPreviewer; 11 | 12 | @interface DJIVideoFeedCachingSession : NSObject 13 | 14 | - (instancetype)init OBJC_UNAVAILABLE("You must use the initWithVideoPreviewer"); 15 | 16 | - (instancetype) initWithVideoPreviewer:(DJIVideoPreviewer*)previewer; 17 | 18 | @property (nonatomic, readonly) DJILiveViewDammyCameraRecordingStatus recordingStatus; 19 | @property (nonatomic, readonly) NSTimeInterval recordedTime; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/Context/DJIVideoFrameSyncPoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoFrameSyncPoint.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | @interface DJIVideoFrameSyncPoint : NSObject 10 | 11 | @property (nonatomic, readonly) uint32_t localTimeMSec; 12 | @property (nonatomic, readonly) uint32_t remoteTimeMSec; 13 | @property (nonatomic, assign) uint32_t caMediaTimeMS; 14 | 15 | -(id) initWith:(uint32_t)local remote:(uint32_t)remote; 16 | +(id) pointWith:(uint32_t)local remote:(uint32_t)remote; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/Context/DJIVideoFrameSyncPoint.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoFrameSyncPoint.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import "DJIVideoFrameSyncPoint.h" 8 | 9 | @implementation DJIVideoFrameSyncPoint 10 | 11 | -(instancetype) copyWithZone:(NSZone *)zone 12 | { 13 | DJIVideoFrameSyncPoint* copy = [DJIVideoFrameSyncPoint pointWith:_localTimeMSec 14 | remote:_remoteTimeMSec]; 15 | copy.caMediaTimeMS = self.caMediaTimeMS; 16 | return copy; 17 | } 18 | 19 | -(instancetype) initWith:(uint32_t)local remote:(uint32_t)remote 20 | { 21 | if(self = [super init]){ 22 | _localTimeMSec = local; 23 | _remoteTimeMSec = remote; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | +(instancetype) pointWith:(uint32_t)local remote:(uint32_t)remote 30 | { 31 | return [[DJIVideoFrameSyncPoint alloc] initWith:local remote:remote]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/Context/DJIVideoWriterContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoWriterContext.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIVideoPoolMp4Muxer.h" 9 | 10 | @interface DJIVideoWriterContext : NSObject 11 | 12 | -(instancetype) initWithNewFile:(NSString *)name; 13 | 14 | @property(nonatomic, strong) DJIVideoPoolMp4Muxer* muxer; 15 | 16 | /** 17 | * counters 18 | */ 19 | @property(nonatomic, assign) int videoFrameCount; 20 | @property(nonatomic, assign) int audioFrameCount; 21 | @property(nonatomic, assign) int overAllFrameCount; 22 | 23 | /** 24 | * file size muxed. 25 | */ 26 | @property(nonatomic, readonly) uint32_t currentFileSize; 27 | 28 | /** 29 | * `NO` file is closed 30 | */ 31 | @property(nonatomic, assign) BOOL isFileClosed; 32 | 33 | /** 34 | * current write file size. 35 | */ 36 | @property(nonatomic, strong) NSString* writeFilePath; 37 | 38 | //Input Infos 39 | @property(nonatomic, assign) int playbackFps; 40 | 41 | +(NSString*) VideoCachePath; 42 | 43 | -(void) closeFile; 44 | 45 | -(BOOL) verifyContextForKeep; 46 | 47 | -(void) deleteAllDiskFile; 48 | 49 | -(BOOL) pushFrame:(VideoFrameH264Raw*)frame; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/Context/Muxer/DJIVideoPoolMp4Muxer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoPoolMp4Muxer.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | #import "DJIStreamCommon.h" 10 | // The h264 stream mux to mp4 file 11 | 12 | @interface DJIVideoPoolMp4Muxer : NSObject 13 | 14 | //mp4 file address 15 | @property (nonatomic, strong, readonly) NSString* dstFilePath; 16 | //mp4 header has been written 17 | @property (nonatomic, readonly) BOOL headWrited; 18 | //The file has ended and cannot be written 19 | @property (nonatomic, readonly) BOOL muxerEnded; 20 | // Support aac audio, default NO 21 | @property (nonatomic, assign) BOOL enableAACAudio; 22 | // Skip the video with no video, default NO; 23 | @property (nonatomic, assign) BOOL skipPureAudio; 24 | 25 | //The total number of frames written 26 | @property (nonatomic, readonly) uint32_t muxedAllFrameCount; 27 | @property (nonatomic, readonly) uint32_t muxedVideoFrameCount; 28 | @property (nonatomic, readonly) uint32_t muxedAudioFrameCount; 29 | 30 | -(id) initWithDstFile:(NSString*)path streamInfo:(VideoFrameH264BasicInfo*)info; 31 | 32 | // Write the frame, the first frame written to mp4 must be an idr with sps, pps, otherwise the frame will be discarded 33 | -(BOOL) pushFrame:(VideoFrameH264Raw*)frame; 34 | -(BOOL) pushAudio:(AudioFrameAACRaw*)frame; 35 | 36 | /** 37 | * The specified frame rate in the video stream 38 | */ 39 | -(double) requiredFPS; 40 | -(void) endFile; 41 | @end 42 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/DJIVideoWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoWriter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | 10 | #define VIDEO_POOL_LOW_DISK_STOP_NOTIFICATION (@"VIDEO_POOL_LOW_DISK_STOP_NOTIFICATION") 11 | 12 | @interface DJIVideoWriter : NSObject 13 | 14 | +(DJIVideoWriter*) instance; 15 | /** 16 | * Current write file size byte. 17 | */ 18 | @property(nonatomic, readonly) uint64_t currentFileSize; 19 | /* 20 | * `YES` is recording. 21 | */ 22 | @property(nonatomic, readonly) BOOL inRecording; 23 | 24 | -(void) updateStreamInfo:(DJIVideoStreamBasicInfo)info; 25 | 26 | -(BOOL) beginVideoWriter; 27 | 28 | -(BOOL) endVideoWriter; 29 | 30 | -(void) writeAsync:(VideoFrameH264Raw*)frame; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/RecordVideo/VideoWriter/DJIVideoWriterDiskHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoWriterDiskHelper.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | //200m 10 | #define VIDEO_POOL_LOW_DISK_SPACE_THRESHOLD (200*1024*1024) 11 | 12 | //a disk helper to mointor the disk remain size 13 | @interface DJIVideoWriterDiskHelper : NSObject 14 | 15 | //this space will auto update every 10sec 16 | @property (nonatomic, readonly) uint64_t freeDiskSpace; 17 | @property (nonatomic, readonly) uint64_t availableSpace; 18 | 19 | -(BOOL) isLowerThanLimitSpace; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/ShootPhoto/DJIAlbumHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIAlbumHandler.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | #import 7 | #import 8 | #import 9 | 10 | #pragma GCC diagnostic push 11 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 12 | typedef void (^DJIAlbumCompletionBlock)(NSURL *assetURL , NSError *error); 13 | typedef void (^DJIAlbumCompletionBlock2)(NSURL *assetURL , ALAsset* asset, NSError *error); 14 | #pragma GCC diagnostic pop 15 | 16 | @interface DJIAlbumHandler : NSObject 17 | 18 | + (void) __attribute__((deprecated)) savePhotoToAssetLibrary:(NSURL *)url completionBlock:(DJIAlbumCompletionBlock)completion; 19 | + (void) __attribute__((deprecated)) savePhotoToAssetLibrary2:(NSURL *)url completionBlock:(DJIAlbumCompletionBlock2)completion; 20 | + (void) __attribute__((deprecated)) saveVideoToAssetLibrary:(NSURL *)url withCompletionBlock:(DJIAlbumCompletionBlock2)completion; 21 | + (void) __attribute__((deprecated)) findOrCreateAssetsGroup:(NSString *)groupName completion:(void (^)(ALAssetsGroup *group, NSError *error))completion assetsLibrary:(ALAssetsLibrary *)library; 22 | @end 23 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoLiveCamera/ShootPhoto/DJILiveViewDammyCameraTakePhotoSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewDammyCameraTakePhotoSession.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJILiveViewDammyCameraSessionProtocol.h" 9 | 10 | @class DJIVideoPreviewer; 11 | /* 12 | * section for taking signle photo from live stream 13 | */ 14 | @interface DJILiveViewDammyCameraTakePhotoSession : NSObject 15 | 16 | - (instancetype)init OBJC_UNAVAILABLE("You must use the initWithVideoPreviewer"); 17 | 18 | -(instancetype) initWithVideoPreviewer:(DJIVideoPreviewer*)previewer; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJIAlbumTransfer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIAlbumTransfer.h 3 | // 4 | // Copyright (c) 2015 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | 10 | #define DJI_IMPORT_DEFAULT_ALBUM (@"DJI Import") 11 | #define DJI_MOMENTS_ALBUM (@"DJI Moments") 12 | #define DJI_FILM_ALBUM (@"DJI Works") 13 | 14 | typedef enum{ 15 | DJIAlbumTransferErrorCode_Unknown = 0, 16 | DJIAlbumTransferErrorCode_FileNotFound, 17 | DJIAlbumTransferErrorCode_FileCannotPlay, 18 | DJIAlbumTransferErrorCode_AlbumCanNotCreate, 19 | DJIAlbumTransferErrorCode_NoDiskSpace 20 | } DJIAlbumTransferErrorCode; 21 | 22 | //For existing video files into photo library 23 | //Returned error code is possible only error,It may also be derived from the system having localized 24 | @interface DJIAlbumTransfer : NSObject 25 | 26 | +(void) writeVidoToAssetLibrary:(NSString*)file completionBlock:(void(^)(NSURL *assetURL, NSError *error))block; 27 | 28 | +(void) writeVideo:(NSString*)file toAlbum:(NSString*)album completionBlock:(void(^)(NSURL *assetURL, NSError *error))block; 29 | +(void) createAlbumIfNotExist:(NSString*)album; 30 | @end 31 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJICustomVideoFrameExtractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJICustomVideoFrameExtractor.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | #import 11 | #import "DJIMovieGLView.h" 12 | 13 | @class DJICustomVideoFrameExtractor; 14 | 15 | @protocol DJIVideoDataProcessDelegate 16 | 17 | @optional 18 | /** 19 | * It is called after the video data is parsed 20 | * 21 | * @param data pointer to the parsed video data 22 | * @param length length in byte 23 | */ 24 | - (void)processVideoData:(uint8_t *)data length:(int)length; 25 | @end 26 | 27 | /** 28 | * check frame state 29 | */ 30 | @protocol DJIVideoDataFrameControlDelegate 31 | 32 | @required 33 | 34 | - (BOOL)parseDecodingAssistInfoWithBuffer:(uint8_t *)buffer length:(int)length assistInfo:(DJIDecodingAssistInfo *)assistInfo; 35 | 36 | - (BOOL)isNeedFitFrameWidth; 37 | 38 | - (void)frameExtractorDidFailToParseFrames:(DJICustomVideoFrameExtractor *)extractor; 39 | 40 | @end 41 | 42 | 43 | @interface DJICustomVideoFrameExtractor : NSObject 44 | 45 | @property (weak) id processDelegate; 46 | @property (weak) id delegate; 47 | 48 | @property (nonatomic, assign) BOOL usingDJIAircraftEncoder; 49 | @property (nonatomic, assign) BOOL shouldVerifyVideoStream; 50 | 51 | @property(nonatomic, readonly) int frameRate; 52 | @property(nonatomic, readonly) int outputWidth; 53 | @property(nonatomic, readonly) int outputHeight; 54 | @property(nonatomic, readonly) double duration; 55 | 56 | /** 57 | * init extractor 58 | * 59 | * @return the extractor 60 | */ 61 | -(id)initExtractor; 62 | 63 | /** 64 | * clean extractor's buffer 65 | */ 66 | - (void)clearExtractorBuffer; 67 | 68 | /** 69 | * release the extractor 70 | */ 71 | -(void)freeExtractor; 72 | 73 | /** 74 | * the frame in block should be released by user 75 | */ 76 | -(void) parseVideo:(uint8_t*)buf length:(int)length withFrame:(void (^)(VideoFrameH264Raw* frame))block; 77 | 78 | 79 | -(void) decodeRawFrame:(VideoFrameH264Raw*)frame callback:(void(^)(BOOL b))callback; 80 | 81 | 82 | /** 83 | * Get yuv Frame 84 | * 85 | * @param yuv YuvFrame 86 | */ 87 | -(void)getYuvFrame:(VideoFrameYUV *)yuv; 88 | 89 | /** 90 | * get the uuid for a frame 91 | * 92 | * @return uuid of the next frame 93 | */ 94 | -(uint32_t) popNextFrameUUID; 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJIDecodeFrameRateMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIDecodeFrameRateMonitor.h 3 | // 4 | // Copyright (c) 2013 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIStreamCommon.h" 9 | 10 | 11 | 12 | @interface DJIDecodeFrameRateMonitor : NSObject 13 | 14 | - (void)newFrameArrived; 15 | 16 | - (NSUInteger)realTimeFrameRate; 17 | 18 | - (void)reset; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJIJpegStreamImageDecoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIJpegStreamImageDecoder.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIStreamCommon.h" 9 | 10 | @interface DJIJpegStreamImageDecoder : NSObject 11 | @property (nonatomic, weak) id frameProcessor; 12 | @property (nonatomic, assign) BOOL enabled; 13 | @end 14 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJISmoothDecode.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJISmoothDecode.h 3 | // 4 | // Copyright (c) 2015 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | @protocol DJISmoothDecodeProtocol 10 | 11 | @required 12 | 13 | /* 14 | * The number of cached frames 15 | */ 16 | -(double) frameBuffered; 17 | 18 | /* 19 | * Decode loop input 20 | * @return interval to sleep 21 | */ 22 | -(double) sleepTimeForCurrentFrame:(double)currentTime framePushInQueueTime:(double)inQueueTime decodeCostTime:(double)decodeTime; 23 | 24 | /* 25 | * reset smooth decoding 26 | */ 27 | -(void) resetSmooth; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJISoftwareDecodeProcessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJISoftwareDecodeProcessor.h 3 | // 4 | // Copyright (c) 2015 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIStreamCommon.h" 9 | #import "DJICustomVideoFrameExtractor.h" 10 | 11 | @interface DJISoftwareDecodeProcessor : NSObject 12 | @property (nonatomic, weak) id frameProcessor; 13 | @property (nonatomic, assign) BOOL enabled; 14 | 15 | -(id) initWithExtractor:(DJICustomVideoFrameExtractor*)extractor; 16 | @end 17 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJIStreamCommon.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIStreamCommon.h 3 | // 4 | // Copyright (c) 2015 DJI. All rights reserved. 5 | // 6 | 7 | #import "DJIStreamCommon.h" 8 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/DJIVideoPoolStructs.h: -------------------------------------------------------------------------------- 1 | // DJIVideoPoolStructs.h 2 | // DJIWidget 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #ifndef DJIWidget_DJIVideoPoolStructs_h 8 | #define DJIWidget_DJIVideoPoolStructs_h 9 | 10 | typedef struct _VideoCacheFrame{ 11 | int size; 12 | uint32_t time_tag; //videoTimeCapsule internal relative time 13 | uint8_t* data; 14 | 15 | } VideoCacheFrame; 16 | 17 | 18 | 19 | typedef struct _DJIVideoPoolFrame{ 20 | uint32_t file_offset; 21 | uint32_t frame_size; 22 | uint32_t time_tag; //videoPool internal relative time 23 | 24 | union{ 25 | struct{ 26 | int has_sps :1; // contains sps information 27 | int has_pps :1; // contains pps information 28 | int has_idr :1; //The frame with idr 29 | } flags; 30 | uint32_t value; 31 | }; 32 | } DJIVideoPoolFrame; 33 | 34 | void ReleaseVideoCacheFrameList(int count, VideoCacheFrame* list); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/H264Parser/DJIVideoPreviewerH264Parser.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoPreviewerH264Parser.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIStreamCommon.h" 9 | 10 | 11 | /** 12 | a pure H264 parser 13 | */ 14 | @interface DJIVideoPreviewerH264Parser : NSObject 15 | 16 | /** 17 | * If the stream is encoded by DJI's encoder. It is used to workaround an issue 18 | * in DJI's encoder. 19 | */ 20 | @property (nonatomic, assign) BOOL usingDJIAircraftEncoder; 21 | 22 | 23 | /** 24 | a rough frame rate 25 | * Need to get accurate frame rate from video stream 26 | */ 27 | @property(nonatomic, readonly) int frameRate; 28 | 29 | /** 30 | frame counter since last reset 31 | */ 32 | @property (nonatomic, readonly) uint32_t frameCounter; 33 | 34 | 35 | /** 36 | video size 37 | */ 38 | @property(nonatomic, readonly) int outputWidth; 39 | @property(nonatomic, readonly) int outputHeight; 40 | 41 | 42 | @property (nonatomic, assign) BOOL shouldVerifyVideoStream; 43 | 44 | 45 | /** 46 | interval detail 47 | */ 48 | @property(nonatomic, readonly) NSTimeInterval frameInterval; 49 | 50 | /** 51 | * the frame in block should be released by user 52 | * set a pointer to used length to check if the buffer contains multi-frame 53 | */ 54 | -(VideoFrameH264Raw*) parseVideo:(uint8_t*)buf 55 | length:(int)length 56 | usedLength:(int*)usedLength; 57 | 58 | /** 59 | * get the uuid for a frame 60 | * 61 | * @return uuid of the next frame 62 | */ 63 | -(uint32_t) popNextFrameUUID; 64 | 65 | 66 | /** 67 | reset parser buffer 68 | */ 69 | -(void) reset; 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIH264FrameRawLayerDumper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIH264FrameRawLayerDumper.h 3 | // 4 | // Copyright (c) 2013 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | #import "DJIStreamCommon.h" 10 | 11 | /** 12 | * for frame layer dump and test 13 | */ 14 | @interface DJIH264FrameRawLayerDumper : NSObject 15 | 16 | /** 17 | * create dump file 18 | */ 19 | -(void) dumpFrame:(VideoFrameH264Raw* _Nonnull)frame; 20 | 21 | -(void) endDumpFile; 22 | 23 | 24 | /** 25 | * open dump file 26 | */ 27 | -(BOOL) openFile:(NSString* _Nonnull)name; 28 | 29 | -( VideoFrameH264Raw* _Nullable ) readNextFrame; 30 | 31 | -(void) seekToHead; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIH264PocQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIH264PocQueue.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | #import 7 | #import "DJIStreamCommon.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | 12 | /** 13 |   A fixed-length priority queue, sorted by poc 14 |   Encounter IDR then split the poc 15 |   Optional lockless, need to operate in the same thread 16 | */ 17 | @interface DJIH264PocQueue : NSObject 18 | 19 | /** 20 |   * Initialize a static pointer loop queue of a given size 21 |   * 22 |   * @param size less than or equal to 0 the queue capacity is empty 23 |   * 24 |   */ 25 | - (id)initWithSize:(int)size 26 | threadSafe:(BOOL)threadSafe; 27 | 28 | /** 29 | * Clear the queue, in which case the queue will be locked 30 | */ 31 | - (void)clear; 32 | 33 | /** 34 | * 35 | * @return number of frames currently in queue 36 | */ 37 | - (int)count; 38 | 39 | /** 40 | * 41 | * @return current queue size 42 | */ 43 | - (int)size; 44 | 45 | /** 46 | * Put the data into the queue (the queue and subsequent queues remove the data.) 47 | * 48 | * @param data object 49 | * 50 | * @return When the return value is No, the queue is full (NO is returned if the queue length is 0) 51 | */ 52 | - (BOOL)push:(VideoFrameYUV*)object; 53 | 54 | /** 55 | * Remove data from the queue 56 | * 57 | * @return When NULL, the queue is empty. 58 | */ 59 | - ( VideoFrameYUV* _Nullable )pull; 60 | 61 | /** 62 | * Checks if queue is full 63 | * 64 | */ 65 | - (bool)isFull; 66 | 67 | /** 68 | * Special usage, for some read thread that is immediately wakeup waiting, the pull method will return null 69 | */ 70 | - (void)wakeupReader; 71 | 72 | 73 | @end 74 | 75 | NS_ASSUME_NONNULL_END 76 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCache/DJIImageCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCache.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCache_h 9 | #define DJIImageCache_h 10 | 11 | @interface DJIImageCache : NSObject 12 | //size array for each image channel 13 | -(instancetype)initWithCacheSizeArray:(NSArray*)sizes; 14 | 15 | -(void*)baseAddrForIndex:(NSUInteger)index; 16 | 17 | -(BOOL)checkFitsSizeArray:(NSArray*)sizes; 18 | 19 | @end 20 | 21 | #endif /* DJIImageCache_h */ 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCache/DJIImageCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCache.m 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJIImageCache.h" 10 | 11 | @interface DJIImageCache(){ 12 | NSArray* _sizes; 13 | void* _baseAddr; 14 | } 15 | @end 16 | 17 | @implementation DJIImageCache 18 | 19 | -(void)dealloc{ 20 | if (_baseAddr != NULL){ 21 | free(_baseAddr); 22 | _baseAddr = NULL; 23 | } 24 | } 25 | 26 | -(instancetype)initWithCacheSizeArray:(NSArray*)sizes{ 27 | if (self = [super init]){ 28 | if ([sizes isKindOfClass:[NSArray class]]){ 29 | _sizes = sizes.copy; 30 | } 31 | else{ 32 | _sizes = nil; 33 | } 34 | _baseAddr = NULL; 35 | [self initMem]; 36 | } 37 | return self; 38 | } 39 | 40 | -(void)initMem{ 41 | NSUInteger sizeNeeded = 0; 42 | for (NSNumber* size in _sizes){ 43 | if (![size isKindOfClass:[NSNumber class]]){ 44 | continue; 45 | } 46 | sizeNeeded += size.unsignedIntegerValue; 47 | } 48 | if (_baseAddr != NULL){ 49 | free(_baseAddr); 50 | _baseAddr = NULL; 51 | } 52 | if (sizeNeeded > 0){ 53 | _baseAddr = malloc(sizeNeeded); 54 | if (_baseAddr != NULL){ 55 | memset(_baseAddr, 0, sizeNeeded); 56 | } 57 | } 58 | } 59 | 60 | -(void*)baseAddrForIndex:(NSUInteger)index{ 61 | if (index >= _sizes.count 62 | || _baseAddr == NULL){ 63 | return NULL; 64 | } 65 | NSNumber* size = [_sizes objectAtIndex:index]; 66 | if (![size isKindOfClass:[NSNumber class]]){ 67 | return NULL; 68 | } 69 | NSUInteger offset = 0; 70 | for (NSUInteger startIndex = 0; startIndex < index; startIndex++){ 71 | NSNumber* size = [_sizes objectAtIndex:startIndex]; 72 | if (![size isKindOfClass:[NSNumber class]]){ 73 | continue; 74 | } 75 | offset += size.unsignedIntegerValue; 76 | } 77 | return (void*)((uint8_t*)_baseAddr + offset); 78 | } 79 | 80 | -(BOOL)checkFitsSizeArray:(NSArray*)sizes{ 81 | if (_sizes == nil){ 82 | return NO; 83 | } 84 | if (![sizes isKindOfClass:[NSArray class]]){ 85 | return NO; 86 | } 87 | return [_sizes isEqualToArray:sizes]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCache/DJIImageCacheQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCacheQueue.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCacheQueue_h 9 | #define DJIImageCacheQueue_h 10 | 11 | @interface DJIImageCacheQueue : NSObject 12 | 13 | -(id)pull; 14 | 15 | -(BOOL)push:(id)cache; 16 | 17 | -(instancetype)initWithThreadSafe:(BOOL)threadSafe; 18 | 19 | @end 20 | 21 | #endif /* DJIImageCacheQueue_h */ 22 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCache/DJIImageCacheQueue.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCacheQueue.m 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJIImageCacheQueue.h" 10 | #import 11 | 12 | @interface DJIImageCacheQueue(){ 13 | NSMutableArray* _queue; 14 | pthread_mutex_t _mutex; 15 | BOOL _threadSafe; 16 | } 17 | @end 18 | 19 | @implementation DJIImageCacheQueue 20 | 21 | -(void)dealloc{ 22 | id cacheObject = nil; 23 | do{ 24 | cacheObject = [self pull]; 25 | } while(cacheObject != nil); 26 | } 27 | 28 | -(instancetype)init{ 29 | if (self = [super init]){ 30 | _threadSafe = YES; 31 | pthread_mutex_init(&_mutex, NULL); 32 | _queue = [NSMutableArray array]; 33 | } 34 | return self; 35 | } 36 | 37 | -(instancetype)initWithThreadSafe:(BOOL)threadSafe{ 38 | if (self = [super init]){ 39 | _threadSafe = threadSafe; 40 | if (_threadSafe){ 41 | pthread_mutex_init(&_mutex, NULL); 42 | } 43 | _queue = [NSMutableArray array]; 44 | } 45 | return self; 46 | } 47 | 48 | -(id)pull{ 49 | if (_threadSafe){ 50 | pthread_mutex_lock(&_mutex); 51 | } 52 | id cache = nil; 53 | if (_queue.count > 0){ 54 | cache = _queue.firstObject; 55 | [_queue removeObjectAtIndex:0]; 56 | } 57 | if (_threadSafe){ 58 | pthread_mutex_unlock(&_mutex); 59 | } 60 | return cache; 61 | } 62 | 63 | -(BOOL)push:(id)cache{ 64 | if (!cache){ 65 | return NO; 66 | } 67 | if (_threadSafe){ 68 | pthread_mutex_lock(&_mutex); 69 | } 70 | [_queue addObject:cache]; 71 | if (_threadSafe){ 72 | pthread_mutex_unlock(&_mutex); 73 | } 74 | return YES; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCache/DJIPixelCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIPixelCache.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | #ifndef DJIPixelCache_h 8 | #define DJIPixelCache_h 9 | 10 | #import 11 | 12 | @interface DJIPixelCache : NSObject 13 | 14 | -(instancetype)initWithFrameWidth:(NSUInteger)width 15 | height:(NSUInteger)height 16 | andFrameType:(OSType)type; 17 | 18 | -(BOOL)checkFitsFrameWidth:(NSUInteger)width 19 | height:(NSUInteger)height 20 | andFrameType:(OSType)type; 21 | 22 | -(CVPixelBufferRef)pixelBuffer; 23 | 24 | @end 25 | 26 | #endif /* DJIPixelCache_h */ 27 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrateHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateHelper.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateHelper_h 9 | #define DJIImageCalibrateHelper_h 10 | 11 | /* 12 | * flow: 13 | * new yuv frame -> update frame info -> render -> calibrated rgba frame -> -> output calibrated yuv frame -> other processer 14 | * 15 | * detail flow of this helper: 16 | * calibrated rgba frame -> pass frame to color converter in render -> combined data to create yuv calibrated frame -> output frame queue 17 | * 18 | */ 19 | 20 | #import 21 | #import 22 | #import 23 | //color converter 24 | #import 25 | 26 | @class DJIImageCalibrateHelper; 27 | 28 | //calibrate helper lift time control delegate 29 | @protocol DJIImageCalibrateDelegate 30 | 31 | @required 32 | //ask delegate to check 33 | -(BOOL)shouldCreateHelper; 34 | //return created helper if needed 35 | -(DJIImageCalibrateHelper*)helperCreated; 36 | //destroy current helper if no needed any mode 37 | -(void)destroyHelper; 38 | //return filter data source for calibration 39 | -(DJIImageCalibrateFilterDataSource*)calibrateDataSource; 40 | 41 | @end 42 | 43 | @protocol DJIImageCalibrateResultHandlerDelegate 44 | 45 | @required 46 | //new frame arrival 47 | -(void)newFrame:(VideoFrameYUV*)frame 48 | arrivalFromHelper:(DJIImageCalibrateHelper*)helper; 49 | 50 | @end 51 | 52 | @interface DJIImageCalibrateHelper : NSObject 53 | 54 | //update info from new frame 55 | -(void)updateFrame:(VideoFrameYUV*)frame; 56 | //push frame to calibrate 57 | -(BOOL)pushFrame:(VideoFrameYUV*)frame; 58 | //process new frame and call handler 59 | -(void)handlePullFrame; 60 | //lock/unlock when render thread created 61 | -(void)renderLockStatus:(BOOL)locked; 62 | //has created calibration thread or render thread 63 | -(BOOL)hasExtraThread; 64 | //stand-alone calibration process 65 | -(BOOL)independancyWithReander; 66 | 67 | //new yuvframe notification 68 | @property (nonatomic,weak) id handler; 69 | 70 | -(instancetype)initShouldCreateCalibrateThread:(BOOL)enabledCalibrateThread 71 | andRenderThread:(BOOL)enabledRenderThread; 72 | 73 | @end 74 | 75 | #endif /* DJIImageCalibrateHelper_h */ 76 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrateHelper_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateHelper_Private.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateHelper_Private_h 9 | #define DJIImageCalibrateHelper_Private_h 10 | 11 | #import 12 | //buffer 13 | #import 14 | #import 15 | #import 16 | #import 17 | 18 | @interface DJIImageCalibrateHelper(){ 19 | //output queue 20 | DJIImageCalibrationFrameQueue* _frameQueue; 21 | //input queue 22 | DJIImageCalibrationFrameQueue* _cacheQueue; 23 | //recycle queue 24 | DJIImageCalibrationFrameQueue* _recycleQueue; 25 | //memory cache queue 26 | DJIImageCacheQueue* _memQueue; 27 | //cvpixelbufferref cache 28 | DJIImageCacheQueue* _pixelRefQueue; 29 | //mutex for render 30 | pthread_mutex_t _render_mutex; 31 | //thread control 32 | BOOL _shouldCreateCalibrateThread; 33 | BOOL _shouldCreateRenderThread; 34 | //current process frame info 35 | VideoFrameYUV _frame; 36 | } 37 | //working queue 38 | @property (nonatomic,strong) dispatch_queue_t workingQueue; 39 | //render queue 40 | @property (nonatomic,strong) dispatch_queue_t renderQueue; 41 | //app state 42 | @property (nonatomic,assign) BOOL isAppActive; 43 | //frame ptr 44 | -(VideoFrameYUV*)framePtr; 45 | //calibration process 46 | -(DJIImageCalibrationFastFrame*)processCalibrationForFrame:(DJIImageCalibrationFastFrame*)frame; 47 | //reusable frame 48 | -(DJIImageCalibrationFastFrame*)reusableFrame; 49 | //memory pool 50 | -(DJIImageCacheQueue*)memoryPool; 51 | //cvpixelbufferref pool 52 | -(DJIImageCacheQueue*)pixelPool; 53 | //called when dealloc,or may cause memory leak 54 | -(void)prepareToClean; 55 | //override 56 | -(void)initData; 57 | -(void)syncData; 58 | -(void)bindData; 59 | -(void)unbindData; 60 | 61 | @end 62 | 63 | #endif /* DJIImageCalibrateHelper_Private_h */ 64 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrationFrame/DJIImageCalibrationFastFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrationFastFrame.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrationFastFrame_h 9 | #define DJIImageCalibrationFastFrame_h 10 | 11 | #import 12 | #import 13 | 14 | /* 15 | * do less memery deep copy for cache 16 | * try to reduce cpu usage 17 | */ 18 | 19 | 20 | @interface DJIImageCalibrationFastFrame : NSObject 21 | 22 | //for queue 23 | @property (nonatomic,strong) DJIImageCalibrationFastFrame* nextFrame; 24 | 25 | @property (nonatomic,readonly) BOOL fastUploadEnabled; 26 | 27 | //to tell the frame data source 28 | @property (nonatomic,weak) id sourceTag; 29 | 30 | -(VideoFrameYUV*)frame; 31 | 32 | -(void)loadFrame:(VideoFrameYUV*)frame 33 | fastUpload:(BOOL)fastUpload; 34 | 35 | -(void)prepareBeforeUsing; 36 | 37 | -(instancetype)initWithFastFrame:(VideoFrameYUV*)frame 38 | fastUpload:(BOOL)fastUpload 39 | andPixelBuffer:(DJIImageCacheQueue*)pixelCache; 40 | 41 | @end 42 | 43 | #endif /* DJIImageCalibrationFastFrame_h */ 44 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrationFrame/DJIImageCalibrationFastFrame_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrationFastFrame_Private.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrationFastFrame_Private_h 9 | #define DJIImageCalibrationFastFrame_Private_h 10 | 11 | #import "DJIImageCalibrationFastFrame.h" 12 | #import "DJIImageCache.h" 13 | #import "DJIPixelCache.h" 14 | 15 | @interface DJIImageCalibrationFastFrame(){ 16 | //cache frame 17 | VideoFrameYUV _internalFrame; 18 | } 19 | //fast-upload 20 | @property (nonatomic,assign) BOOL fastUploadEnabled; 21 | //frame 22 | @property (nonatomic,readonly) VideoFrameYUV* frame; 23 | //pixel cache manager queue, passed from outside 24 | @property (nonatomic,weak) DJIImageCacheQueue* pixelQueue; 25 | //pixel mem cache 26 | @property (nonatomic,strong) DJIPixelCache* pixel; 27 | //frame cache manager queue, passed from outside 28 | @property (nonatomic,weak) DJIImageCacheQueue* cacheQueue; 29 | //frame mem cache 30 | @property (nonatomic,strong) DJIImageCache* cache; 31 | //fastupload type 32 | @property (nonatomic,assign) OSType fastUploadType; 33 | 34 | //reconstruct CVPixelBufferRef for fast-upload frame 35 | -(void)reconstructFastUploadFrame; 36 | 37 | //operation beform reload or dealloc 38 | -(void)prepareToClean; 39 | 40 | @end 41 | 42 | #endif /* DJIImageCalibrationFastFrame_Private_h */ 43 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrationFrame/DJIImageCalibrationFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrationFrame.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrationFrame_h 9 | #define DJIImageCalibrationFrame_h 10 | 11 | #import 12 | 13 | /* 14 | * do more memery deep copy for cache than DJIImageCalibrationFastFrame 15 | * may cause high cpu usage 16 | */ 17 | 18 | @interface DJIImageCalibrationFrame : DJIImageCalibrationFastFrame 19 | 20 | -(instancetype)initWithFrame:(VideoFrameYUV*)frame 21 | fastUpload:(BOOL)fastUpload 22 | pixelCacheQueue:(DJIImageCacheQueue*)pixelQueue 23 | andMemCacheQueue:(DJIImageCacheQueue*)cacheQueue; 24 | 25 | @end 26 | 27 | #endif /* DJIImageCalibrationFrame_h */ 28 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIImageCalibrationFrame/DJIImageCalibrationFrameQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrationFrameQueue.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrationFrameQueue_h 9 | #define DJIImageCalibrationFrameQueue_h 10 | 11 | #import 12 | 13 | @interface DJIImageCalibrationFrameQueue : NSObject 14 | 15 | -(instancetype)initWithQueueCapacity:(NSUInteger)capacity 16 | andThreadSafe:(BOOL)threadSafe; 17 | 18 | -(BOOL)push:(DJIImageCalibrationFastFrame*)frame; 19 | 20 | -(DJIImageCalibrationFastFrame*)pull; 21 | 22 | @end 23 | 24 | #endif /* DJIImageCalibrationFrameQueue_h */ 25 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/DJIVideoPresentViewAdjustHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVideoPresentViewAdjustHelper.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIStreamCommon.h" 9 | 10 | /** 11 | * Helper used to assist the view renderer (glView) in size adjustment. 12 | */ 13 | @interface DJIVideoPresentViewAdjustHelper : NSObject 14 | /** 15 | * Rect represents the content to be clipped. It is relative rect proportional 16 | * to the rect of the scene. the x, y, width, and height values must all be 17 | * between 0 and 1.0. 18 | * When either width or height is 0, the full frame will be used. 19 | * Renderer will adjust the view's size based on the rect. 20 | */ 21 | @property (assign, nonatomic) CGRect contentClipRect; 22 | 23 | // bound of video container 24 | @property (assign, nonatomic) CGRect boundingFrame; 25 | 26 | // video size in stream space 27 | @property (assign, nonatomic) CGSize videoSize; 28 | 29 | // last frame of video content 30 | @property (assign, nonatomic) CGRect lastFrame; 31 | 32 | // rotation of the stream 33 | @property (assign, nonatomic) VideoStreamRotationType rotation; 34 | 35 | // content fill mode 36 | @property (assign, nonatomic) VideoPresentContentMode contentMode; 37 | 38 | //get the final frame 39 | -(CGRect) getFinalFrame; 40 | 41 | +(CGRect) normalizeFrame:(CGRect)frame withIdentityRect:(CGRect)rect; 42 | +(CGRect) aspectFitWithFrame:(CGRect)frame size:(CGSize)size; 43 | +(CGRect) aspectFillWithFrame:(CGRect)frame size:(CGSize)size; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIDecodeImageCalibrateDataBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIDecodeImageCalibrateDataBuffer.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIDecodeImageCalibrateDataBuffer_h 9 | #define DJIDecodeImageCalibrateDataBuffer_h 10 | 11 | #import "DJILiveViewFrameBuffer.h" 12 | 13 | @class DJIDecodeImageCalibrateDataBuffer; 14 | 15 | @protocol DJIDecodeImageCalibrateDataBufferHandlerDelegate 16 | @required 17 | -(void)dataBuffer:(DJIDecodeImageCalibrateDataBuffer*)dataBuffer 18 | arrivalRGBAData:(uint8_t*)rgbaData 19 | withSize:(CGSize)size; 20 | 21 | @end 22 | 23 | @interface DJIDecodeImageCalibrateDataBuffer : DJILiveViewFrameBuffer 24 | 25 | //call back via delegate 26 | -(void)requestRGBAPixelBuffer; 27 | 28 | //direct return buffer 29 | -(uint8_t*)rgbaPixelBuffer; 30 | 31 | //render buffer, for fast upload 32 | -(CVPixelBufferRef)renderTarget; 33 | 34 | @property (nonatomic,weak) id dataBufferHandler; 35 | 36 | @property (nonatomic,assign) NSUInteger bufferFlag; 37 | 38 | @end 39 | 40 | #endif /* DJIDecodeImageCalibrateDataBuffer_h */ 41 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIDecodeImageCalibrateDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIDecodeImageCalibrateDataSource.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIDecodeImageCalibrateDataSource_h 9 | #define DJIDecodeImageCalibrateDataSource_h 10 | 11 | #import 12 | 13 | @interface DJIDecodeImageCalibrateDataSource : DJILiveViewRenderDataSource 14 | 15 | @end 16 | 17 | #endif /* DJIDecodeImageCalibrateDataSource_h */ 18 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIDecodeImageCalibrateDataSource.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIDecodeImageCalibrateDataSource.m 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJIDecodeImageCalibrateDataSource.h" 10 | //header 11 | #import "DJILiveViewRenderDataSource_Private.h" 12 | //buffer 13 | #import "DJIDecodeImageCalibrateDataBuffer.h" 14 | 15 | @interface DJIDecodeImageCalibrateDataSource(){ 16 | CGSize _inputSize; 17 | } 18 | @end 19 | 20 | @implementation DJIDecodeImageCalibrateDataSource 21 | 22 | -(void)configOutputBuffer{ 23 | if (outputFramebuffer == nil 24 | || !CGSizeEqualToSize(_inputSize, outputFramebuffer.size)){ 25 | //do create 26 | } 27 | else{ 28 | return; 29 | } 30 | outputFramebuffer = [[DJIDecodeImageCalibrateDataBuffer alloc] initWithContext:context 31 | size:_inputSize]; 32 | } 33 | 34 | -(void) loadFrame:(VideoFrameYUV*)yuvFrame{ 35 | if (yuvFrame != NULL){ 36 | _inputSize = CGSizeMake(yuvFrame->width, yuvFrame->height); 37 | } 38 | [super loadFrame:yuvFrame]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIDecodeImageCalibrateHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIDecodeImageCalibrateHelper.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIDecodeImageCalibrateHelper_h 9 | #define DJIDecodeImageCalibrateHelper_h 10 | 11 | #import 12 | //filter 13 | #import 14 | 15 | /* 16 | * flow: 17 | * new yuv frame -> update frame info -> -> output calibrated yuv frame -> render -> other processer 18 | * 19 | * detail flow of this helper: 20 | * new yuv frame -> calibration filters -> calibrated rgba frame -> color converter -> yuv calibrated queue -> output frame queue 21 | * 22 | */ 23 | 24 | @interface DJIDecodeImageCalibrateHelper : DJIImageCalibrateHelper 25 | 26 | -(DJILiveViewCalibrateFilter*)calibrateFilter; 27 | 28 | //enabled color converter: rgba->yuv, default NO 29 | @property (nonatomic,assign) BOOL enabledColorSpaceConverter; 30 | 31 | @end 32 | 33 | #endif /* DJIDecodeImageCalibrateHelper_h */ 34 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIImageCalibrateColorCPUConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateColorCPUConverter.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateColorCPUConverter_h 9 | #define DJIImageCalibrateColorCPUConverter_h 10 | 11 | #import "DJIImageCalibrateColorConverter.h" 12 | 13 | //rgba->yuv 14 | @interface DJIImageCalibrateColorCPUConverter : DJIImageCalibrateColorConverter 15 | 16 | //FIXED ME:Need to optimize, this conversion will take up a higher CPU, please be cautious 17 | -(void)convertFromRGBA:(uint8_t*)rgba 18 | withSize:(CGSize)size; 19 | 20 | @end 21 | 22 | #endif /* DJIImageCalibrateColorCPUConverter_h */ 23 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIImageCalibrateColorConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateColorConverter.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | #ifndef DJIImageCalibrateColorConverter_h 8 | #define DJIImageCalibrateColorConverter_h 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | @class DJIImageCalibrateColorConverter; 18 | 19 | @protocol DJIImageCalibrateColorConverterHandlerProtocol 20 | @required 21 | /* 22 | * rgba->yuvData array count = 1(rgba); 23 | * yuv420Planer->yuvData array count = 3(y+u+v); 24 | * yuv420BiPlaner->yuvData array count = 2(y+uv) 25 | * yuvSlice array count same as the yuvData 26 | * fastupload, the pixelbuffer pointer, usually NULL in yuv 27 | */ 28 | -(void)colorConverter:(DJIImageCalibrateColorConverter*)converter 29 | passYUVData:(uint8_t**)yuvData 30 | yuvSlice:(int*)yuvSlice 31 | withFastload:(CVPixelBufferRef)fastload; 32 | @end 33 | 34 | @interface DJIImageCalibrateColorConverterHolder : NSObject 35 | //target converter 36 | @property (nonatomic,weak) DJIImageCalibrateColorConverter* converter; 37 | 38 | @end 39 | 40 | @interface DJIImageCalibrateColorConverter : NSObject 41 | 42 | @property (nonatomic,weak) id delegate; 43 | 44 | -(instancetype)initWithFrameType:(VPFrameType)type; 45 | 46 | //output type 47 | @property (nonatomic,readonly) VPFrameType type; 48 | 49 | //default NO 50 | @property (nonatomic,assign) BOOL enabledConverter; 51 | 52 | -(DJIImageCalibrateColorConverterHolder*)holder; 53 | 54 | @end 55 | 56 | #endif /* DJIImageCalibrateColorConverter_h */ 57 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIImageCalibrateColorConverter_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateColorConverter_Private.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateColorConverter_Private_h 9 | #define DJIImageCalibrateColorConverter_Private_h 10 | 11 | #import "DJIImageCalibrateColorConverter.h" 12 | 13 | @interface DJIImageCalibrateColorConverter(){ 14 | DJIImageCalibrateColorConverterHolder* _holder; 15 | } 16 | //output type 17 | @property (nonatomic,assign) VPFrameType type; 18 | 19 | //call back delegate 20 | -(void)handlerYUVData:(uint8_t**)yuvData 21 | andYUVSlice:(int*)slice 22 | withFastUpload:(CVPixelBufferRef)fastUpload; 23 | 24 | //holder 25 | - (BOOL)enabledColorConverter; 26 | 27 | - (void)setColorConverterInputSize:(CGSize)newSize 28 | atIndex:(NSInteger)textureIndex; 29 | 30 | - (void)setColorConverterInputFramebuffer:(DJILiveViewFrameBuffer*)newInputFramebuffer 31 | atIndex:(NSInteger)textureIndex; 32 | 33 | - (void)newColorConverterFrameReadyAtTime:(CMTime)frameTime 34 | atIndex:(NSInteger)textureIndex; 35 | 36 | - (void)endProcessingColorConverter; 37 | 38 | @end 39 | 40 | #endif /* DJIImageCalibrateColorConverter_Private_h */ 41 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIImageCalibrateColorGPUConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateColorGPUConverter.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateColorGPUConverter_h 9 | #define DJIImageCalibrateColorGPUConverter_h 10 | 11 | #import "DJIImageCalibrateColorConverter.h" 12 | #import 13 | #import 14 | #import "DJILiveViewRenderContext.h" 15 | 16 | @interface DJIImageCalibrateColorGPUConverter : DJIImageCalibrateColorConverter 17 | 18 | @property (nonatomic,weak) DJILiveViewRenderContext* context; 19 | //default YES, for more effective 20 | @property (nonatomic,assign) BOOL combinedChannel; 21 | 22 | +(VPFrameType)proposedType; 23 | 24 | @end 25 | 26 | #endif /* DJIImageCalibrateColorGPUConverter_h */ 27 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIImageCalibrateFilterDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateFilterDataSource.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJIImageCalibrateFilterDataSource_h 9 | #define DJIImageCalibrateFilterDataSource_h 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | @interface DJIImageCalibrateFilterDataSource : NSObject 16 | 17 | -(void)loadDataForFrameSize:(CGSize)frameSize; 18 | 19 | -(BOOL)checkDataReadyForFrameSize:(CGSize)frameSize; 20 | 21 | //size:bytes 22 | -(void)getVertexIndexDataForFrameSize:(CGSize)frameSize 23 | andHandler:(void(^)(GLuint* data,NSUInteger size))handler; 24 | 25 | //stride:bytes 26 | -(void)getVertexDataForFrameSize:(CGSize)frameSize 27 | andHandler:(void(^)(GLfloat* data,NSUInteger stride,NSUInteger totalIndex))handler; 28 | 29 | //actual data index for lut index & fov state 30 | -(NSUInteger)dataIndexForResolution:(CGSize)resolution 31 | lutIndex:(NSUInteger)index 32 | andFovState:(DJISEIInfoLiveViewFOVState)fovState; 33 | 34 | //camera work mode:capture or record 35 | @property (nonatomic,readonly) NSUInteger workMode; 36 | 37 | +(instancetype)instanceWithWorkMode:(NSUInteger)workMode; 38 | 39 | @end 40 | 41 | #endif /* DJIImageCalibrateFilterDataSource_h */ 42 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIMavic2ProCameraImageCalibrateFilterDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIMavic2ProCameraImageCalibrateFilterDataSource.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | 9 | #import 10 | 11 | @interface DJIMavic2ProCameraImageCalibrateFilterDataSource : DJIImageCalibrateFilterDataSource 12 | 13 | @end 14 | 15 | 16 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIMavic2ZoomCameraImageCalibrateFilterDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIMavic2ZoomCameraImageCalibrateFilterDataSource.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | 9 | #import "DJIMavic2ProCameraImageCalibrateFilterDataSource.h" 10 | 11 | @interface DJIMavic2ZoomCameraImageCalibrateFilterDataSource : DJIMavic2ProCameraImageCalibrateFilterDataSource 12 | 13 | @end 14 | 15 | 16 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/DJIMavic2ZoomCameraImageCalibrateFilterDataSource.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIMavic2ZoomCameraImageCalibrateFilterDataSource.m 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJIMavic2ZoomCameraImageCalibrateFilterDataSource.h" 10 | 11 | 12 | @implementation DJIMavic2ZoomCameraImageCalibrateFilterDataSource 13 | 14 | #pragma mark - files info overrided 15 | -(NSString*)sensorType{ 16 | return @"imx477"; 17 | } 18 | 19 | -(NSString*)fileNameFormatWithResolution:(CGSize)resolution 20 | zoomIdx:(int)zoomIdx 21 | focusIdx:(int)focusIdx 22 | splitIdx:(int)splitIdx 23 | andFileDiscriptionInfo:(NSString*)desc{ 24 | NSString* sensor = [self sensorType]; 25 | int width = (int)(resolution.width + 0.5); 26 | int height = (int)(resolution.height + 0.5); 27 | //example:[sesor name]_[intput resolution]_to_[output resolution]_[zoom index]_[focus index]_[split index]_[desc].bin 28 | return [NSString stringWithFormat:@"%@_%dx%d_to_%dx%d_%d_%d_%d_%@", 29 | sensor, 30 | width,height, 31 | width,height, 32 | zoomIdx,focusIdx,splitIdx, 33 | desc]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/Holder/DJIImageCalibrateHelperHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateHelperHolder.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | 9 | 10 | 11 | #ifndef DJIImageCalibrateHelperHolder_h 12 | #define DJIImageCalibrateHelperHolder_h 13 | 14 | #import 15 | 16 | @interface DJIImageCalibrateHelperHolder : NSObject 17 | 18 | @property (nonatomic,weak) id target; 19 | 20 | @end 21 | 22 | #endif /* DJIImageCalibrateHelperHolder_h */ 23 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/Holder/DJIImageCalibrateHelperHolder.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIImageCalibrateHelperHolder.m 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJIImageCalibrateHelperHolder.h" 10 | 11 | @implementation DJIImageCalibrateHelperHolder 12 | 13 | - (BOOL)enabled{ 14 | id target = _target; 15 | if (target != nil 16 | && [target respondsToSelector:_cmd]){ 17 | return [target enabled]; 18 | } 19 | return NO; 20 | } 21 | 22 | - (void)setInputSize:(CGSize)newSize 23 | atIndex:(NSInteger)textureIndex{ 24 | if (![self enabled]){ 25 | return; 26 | } 27 | id target = _target; 28 | if (target != nil 29 | && [target respondsToSelector:_cmd]){ 30 | [target setInputSize:newSize 31 | atIndex:textureIndex]; 32 | } 33 | } 34 | 35 | - (void)setInputFramebuffer:(DJILiveViewFrameBuffer *)newInputFramebuffer 36 | atIndex:(NSInteger)textureIndex{ 37 | if (![self enabled]){ 38 | return; 39 | } 40 | id target = _target; 41 | if (target != nil 42 | && [target respondsToSelector:_cmd]){ 43 | [target setInputFramebuffer:newInputFramebuffer 44 | atIndex:textureIndex]; 45 | } 46 | } 47 | 48 | - (void)newFrameReadyAtTime:(CMTime)frameTime 49 | atIndex:(NSInteger)textureIndex{ 50 | if (![self enabled]){ 51 | return; 52 | } 53 | id target = _target; 54 | if (target != nil 55 | && [target respondsToSelector:_cmd]){ 56 | [target newFrameReadyAtTime:frameTime 57 | atIndex:textureIndex]; 58 | } 59 | } 60 | 61 | - (void)endProcessing{ 62 | if (![self enabled]){ 63 | return; 64 | } 65 | id target = _target; 66 | if (target != nil 67 | && [target respondsToSelector:_cmd]){ 68 | [target endProcessing]; 69 | } 70 | } 71 | 72 | @end 73 | 74 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Helper/ImageCalibrate/PixelBufferProvider/DJICalibratePixelBufferProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJICalibratePixelBufferProvider.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DJILiveViewRenderPass.h" 10 | #import "DJIStreamCommon.h" 11 | 12 | 13 | @protocol DJICalibratePixelBufferProviderDelegate 14 | 15 | @required 16 | - (void)calibratePixelBufferProviderDidOutputFrame:(VideoFrameYUV *)frame; 17 | 18 | @end 19 | 20 | 21 | @interface DJICalibratePixelBufferProvider : NSObject 22 | 23 | @property (atomic, assign) BOOL providerEnabled; 24 | 25 | @property (nonatomic, weak) id delegate; 26 | 27 | - (void)updateFrameInfoWithFrameYUV:(VideoFrameYUV *)frame; 28 | 29 | - (BOOL)enabled; 30 | 31 | - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex; 32 | 33 | - (void)setInputFramebuffer:(DJILiveViewFrameBuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; 34 | 35 | - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; 36 | 37 | - (void)endProcessing; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Lb2AUD/DJILB2AUDRemoveParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILB2AUDRemoveParser.h 3 | // 4 | // Copyright (c) 2013 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | /* 10 | Some version of LB2 will prefix each slice with AUD. DJIVideoPreviewer need to parse the stream before the stream is parsed by avparser. 11 | E.g. 12 | frame1_slice1 13 | AUD, .... 14 | frame1_slice2 15 | AUD, .... 16 | 000000010c 17 | frame2_slice1 18 | AUD, .... 19 | frame2_slice2 20 | AUD, .... 21 | 000000010c 22 | 23 | Also we found that there is an isssue in the stream sent by Lightbridge 2. Whenever there are two adjacent AUDs, the decoder may fail. This workaround will detect this scenario and remove the AUDs. 24 | */ 25 | 26 | @protocol DJILB2AUDRemoveParserDelegate 27 | -(void) lb2AUDRemoveParser:(id)parser didParsedData:(void*)data size:(int)size; 28 | @end 29 | 30 | @interface DJILB2AUDRemoveParser : NSObject 31 | @property (nonatomic, weak) id delegate; 32 | 33 | -(id) init; 34 | -(void) parse:(void*)data_in inSize:(int)in_size; 35 | -(void) reset; 36 | @end 37 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewFrameBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewFrameBuffer.h 3 | // 4 | 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | 12 | 13 | typedef struct DJILiveViewRenderTextureOptions { 14 | GLenum minFilter; 15 | GLenum magFilter; 16 | GLenum wrapS; 17 | GLenum wrapT; 18 | GLenum internalFormat; 19 | GLenum format; 20 | GLenum type; 21 | } DJILiveViewRenderTextureOptions; 22 | 23 | DJILiveViewRenderTextureOptions defaultOptionsForTexture(void); 24 | 25 | @interface DJILiveViewFrameBuffer : NSObject 26 | 27 | @property(readonly) CGSize size; 28 | @property(readonly) DJILiveViewRenderTextureOptions textureOptions; 29 | @property(readonly) GLuint texture; 30 | @property(readonly) BOOL missingFramebuffer; 31 | @property(readonly) BOOL released; 32 | @property(readonly) id context; 33 | 34 | // Initialization and teardown 35 | - (id)initWithContext:(id)context 36 | size:(CGSize)framebufferSize; 37 | 38 | - (id)initWithContext:(id)context 39 | size:(CGSize)framebufferSize 40 | textureOptions:(DJILiveViewRenderTextureOptions)fboTextureOptions 41 | onlyTexture:(BOOL)onlyGenerateTexture; 42 | 43 | - (id)initWithContext:(id)context 44 | size:(CGSize)framebufferSize 45 | overriddenTexture:(GLuint)inputTexture; 46 | 47 | // Usage 48 | - (void)activateFramebuffer; 49 | - (void)destroyFramebuffer; 50 | 51 | // Image capture 52 | - (CGImageRef)newCGImageFromFramebufferContents; 53 | - (void)restoreRenderTarget; 54 | 55 | // Raw data bytes 56 | - (void)lockForReading; 57 | - (void)unlockAfterReading; 58 | - (NSUInteger)bytesPerRow; 59 | - (GLubyte *)byteBuffer; 60 | - (CVPixelBufferRef)pixelBuffer; 61 | @end 62 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewFrameBuffer_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewFrameBuffer_Private.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJILiveViewFrameBuffer_Private_h 9 | #define DJILiveViewFrameBuffer_Private_h 10 | 11 | #import "DJILiveViewFrameBuffer.h" 12 | #import "DJILiveViewRenderContext.h" 13 | 14 | @interface DJILiveViewFrameBuffer(){ 15 | GLuint framebuffer; 16 | CVPixelBufferRef renderTarget; 17 | CVOpenGLESTextureRef renderTexture; 18 | NSUInteger readLockCount; 19 | NSUInteger framebufferReferenceCount; 20 | BOOL referenceCountingDisabled; 21 | } 22 | 23 | @property (nonatomic, strong) DJILiveViewRenderContext* context; 24 | 25 | - (void)generateFramebuffer; 26 | - (void)generateTexture; 27 | - (void)destroyFramebuffer; 28 | - (CVPixelBufferRef)privateRenderTarget; 29 | 30 | @end 31 | 32 | #endif /* DJILiveViewFrameBuffer_Private_h */ 33 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderCommon.h 3 | // 4 | 5 | #import 6 | 7 | #define STRINGIZE(x) #x 8 | #define STRINGIZE2(x) STRINGIZE(x) 9 | #define SHADER_STRING(text) @ STRINGIZE2(text) 10 | 11 | static NSString *const passThroughVS = SHADER_STRING 12 | ( 13 | //input 14 | attribute vec4 position; 15 | attribute vec2 texcoord; 16 | 17 | //to fragment shader 18 | varying vec2 v_texcoord; 19 | varying vec4 v_overexp_texcoord; 20 | 21 | void main() 22 | { 23 | gl_Position = position; 24 | v_texcoord = texcoord.xy; 25 | } 26 | ); 27 | 28 | //passthrough FS 29 | static NSString *const passthroughFS = SHADER_STRING 30 | ( 31 | varying highp vec2 v_texcoord; 32 | varying highp vec4 v_overexp_texcoord; 33 | 34 | uniform sampler2D s_texture; 35 | 36 | void main() 37 | { 38 | //get rgb color 39 | highp vec4 rgb_color = texture2D(s_texture, v_texcoord); 40 | gl_FragColor = vec4(ret_color.xyz, 1.0); 41 | } 42 | ); 43 | 44 | static const GLfloat g_defaultVertexs[8] = { 45 | -1.0f, // x0 46 | -1.0f, // y0 47 | 48 | 1.0f, // .. 49 | -1.0f, 50 | 51 | -1.0f, 52 | 1.0f, 53 | 54 | 1.0f, // x3 55 | 1.0f, // y3 56 | }; 57 | 58 | static const GLfloat g_yuvQuadTexCoordsNormal[] = { 59 | 0.0f, 0.0f, 60 | 1.0f, 0.0f, 61 | 0.0f, 1.0f, 62 | 1.0f, 1.0f, 63 | }; 64 | 65 | static const GLfloat g_yuvQuadTexCoords90CW[] = { 66 | 0.0f, 1.0f, 67 | 0.0f, 0.0f, 68 | 1.0f, 1.0f, 69 | 1.0f, 0.0f, 70 | }; 71 | 72 | static const GLfloat g_yuvQuadTexCoords180CW[] = { 73 | 1.0f, 1.0f, 74 | 0.0f, 1.0f, 75 | 1.0f, 0.0f, 76 | 0.0f, 0.0f, 77 | }; 78 | 79 | static const GLfloat g_yuvQuadTexCoords270CW[] = { 80 | 1.0f, 0.0f, 81 | 1.0f, 1.0f, 82 | 0.0f, 0.0f, 83 | 0.0f, 1.0f, 84 | 85 | }; 86 | 87 | @interface DJILiveViewRenderCommon : NSObject 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderCommon.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderCommon.m 3 | // 4 | 5 | #import "DJILiveViewRenderCommon.h" 6 | 7 | @implementation DJILiveViewRenderCommon 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderContext.h 3 | // 4 | 5 | #import 6 | #import "DJILiveViewRenderProgram.h" 7 | #import 8 | 9 | //Copy from GPUImageContext, reomove frame buffer cache and queue managing 10 | @interface DJILiveViewRenderContext : NSObject 11 | 12 | -(id) init; 13 | -(id) initWithMultiThreadSupport:(BOOL)multiThread; 14 | 15 | 16 | @property (nonatomic) CMMemoryPoolRef memoryPool; 17 | @property(readonly, retain, nonatomic) DJILiveViewRenderProgram *currentShaderProgram; 18 | @property(readonly, retain, nonatomic) EAGLContext *context; 19 | @property(readonly) CVOpenGLESTextureCacheRef coreVideoTextureCache; 20 | //yes if context is already released 21 | @property (readonly) BOOL released; 22 | //release 23 | -(void) releaseContext; 24 | 25 | - (void)useAsCurrentContext; 26 | - (void)setContextShaderProgram:(DJILiveViewRenderProgram *)shaderProgram; 27 | 28 | - (void)presentBufferForDisplay; 29 | - (DJILiveViewRenderProgram *)programForVertexShaderString:(NSString *)vertexShaderString 30 | fragmentShaderString:(NSString *)fragmentShaderString; 31 | 32 | // Manage fast texture upload 33 | + (BOOL)supportsFastTextureUpload; 34 | + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; 35 | + (GLint)maximumTextureSizeForThisDevice; 36 | @end 37 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderDisplayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderDisplayView.h 3 | // 4 | 5 | #import 6 | #import "DJILiveViewRenderPass.h" 7 | 8 | typedef NS_ENUM(NSUInteger, DJILiveViewRenderType) { 9 | kDJILiveViewRenderStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio 10 | kDJILiveViewRenderPreserveAspectRatio, // Maintains the aspect ratio of the source image, adding bars of the specified background color 11 | kDJILiveViewRenderPreserveAspectRatioAndFill // Maintains the aspect ratio of the source image, zooming in on its center to fill the view 12 | }; 13 | 14 | 15 | @interface DJILiveViewRenderDisplayView : UIView 16 | 17 | - (id)initWithFrame:(CGRect)frame context:(DJILiveViewRenderContext*)context; 18 | 19 | /** The fill mode dictates how images are fit in the view, with the default being kGPUImageFillModePreserveAspectRatio 20 | */ 21 | @property(readwrite, nonatomic) DJILiveViewRenderType fillMode; 22 | 23 | 24 | /** This calculates the current display size, in pixels, taking into account Retina scaling factors 25 | */ 26 | @property(readonly, nonatomic) CGSize sizeInPixels; 27 | 28 | @property(nonatomic) BOOL enabled; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderPass.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderPass.h 3 | // 4 | 5 | #import 6 | #import 7 | #import "DJILiveViewFrameBuffer.h" 8 | #import "DJILiveViewRenderContext.h" 9 | 10 | @protocol DJILiveViewRenderInput 11 | - (BOOL)enabled; 12 | 13 | - (void)setInputSize:(CGSize)newSize 14 | atIndex:(NSInteger)textureIndex; 15 | 16 | - (void)setInputFramebuffer:(DJILiveViewFrameBuffer *)newInputFramebuffer 17 | atIndex:(NSInteger)textureIndex; 18 | 19 | - (void)newFrameReadyAtTime:(CMTime)frameTime 20 | atIndex:(NSInteger)textureIndex; 21 | 22 | - (void)endProcessing; 23 | @end 24 | 25 | /* 26 | * a render pass is a step of render, with at least one texture input, one for output 27 | */ 28 | @interface DJILiveViewRenderPass : NSObject{ 29 | DJILiveViewRenderContext* context; 30 | DJILiveViewFrameBuffer *outputFramebuffer; 31 | NSMutableArray *targets, *targetTextureIndices; 32 | CGSize inputTextureSize, forcedMaximumSize; 33 | BOOL overrideInputSize; 34 | BOOL usingNextFrameForImageCapture; 35 | } 36 | 37 | @property (assign, nonatomic) BOOL enabled; 38 | @property (assign, nonatomic) BOOL released; 39 | @property (assign, nonatomic) DJILiveViewRenderTextureOptions outputTextureOptions; 40 | 41 | -(instancetype) initWithContext:(DJILiveViewRenderContext*)context; 42 | 43 | /* 44 | * call before dealloc 45 | */ 46 | -(void) releaseResources; 47 | 48 | /** Adds a target to receive notifications when new frames are available. 49 | 50 | See [GPUImageInput newFrameReadyAtTime:] 51 | 52 | @param newTarget Target to be added 53 | */ 54 | - (void)addTarget:(id)newTarget atTextureLocation:(NSInteger)textureLocation; 55 | 56 | /** Removes a target. The target will no longer receive notifications when new frames are available. 57 | 58 | @param targetToRemove Target to be removed 59 | */ 60 | - (void)removeTarget:(id)targetToRemove; 61 | 62 | /** Removes all targets. 63 | */ 64 | - (void)removeAllTargets; 65 | 66 | - (void)setInputFramebufferForTarget:(id)target 67 | atIndex:(NSInteger)inputTextureIndex; 68 | 69 | #pragma mark - result output 70 | - (DJILiveViewFrameBuffer*) framebufferForOutput; 71 | - (CGImageRef)newCGImageFromCurrentlyProcessedOutput; 72 | - (UIImage *)imageFromCurrentFramebuffer; 73 | @end 74 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Base/DJILiveViewRenderProgram.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderProgram.h 3 | // 4 | 5 | #import 6 | #import 7 | #import 8 | 9 | @class DJILiveViewRenderContext; 10 | 11 | //Just copy from GPUImage GLProgram, rename it to avoid duplicated symbols 12 | @interface DJILiveViewRenderProgram : NSObject 13 | { 14 | NSMutableArray *attributes; 15 | NSMutableArray *uniforms; 16 | GLuint program, 17 | vertShader, 18 | fragShader; 19 | } 20 | 21 | @property(readwrite, nonatomic) BOOL initialized; 22 | @property(readonly, nonatomic) BOOL released; 23 | @property(readonly, nonatomic) DJILiveViewRenderContext* context; 24 | @property(readwrite, copy, nonatomic) NSString *vertexShaderLog; 25 | @property(readwrite, copy, nonatomic) NSString *fragmentShaderLog; 26 | @property(readwrite, copy, nonatomic) NSString *programLog; 27 | 28 | - (id)initWithContext:(DJILiveViewRenderContext*)ctx 29 | vertexShaderString:(NSString *)vShaderString 30 | fragmentShaderString:(NSString *)fShaderString; 31 | 32 | - (void)addAttribute:(NSString *)attributeName; 33 | - (GLuint)attributeIndex:(NSString *)attributeName; 34 | - (GLuint)uniformIndex:(NSString *)uniformName; 35 | - (BOOL)link; 36 | - (void)use; 37 | - (void)validate; 38 | - (void)destory; 39 | @end 40 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/CalibrateFilter/DJILiveViewCalibrateFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewCalibrateFilter.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJILiveViewCalibrateFilter_h 9 | #define DJILiveViewCalibrateFilter_h 10 | 11 | #import 12 | #import 13 | 14 | @interface DJILiveViewCalibrateFilter : DJILiveViewRenderFilter 15 | 16 | @property (nonatomic,assign) NSUInteger idx; 17 | 18 | @property (nonatomic,assign) DJISEIInfoLiveViewFOVState fovState; 19 | 20 | @property (nonatomic,weak) DJIImageCalibrateFilterDataSource* dataSource; 21 | 22 | @end 23 | 24 | #endif /* DJILiveViewCalibrateFilter_h */ 25 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ColorMatrixFilter/DJILiveViewRenderColorMatrixFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderColorMatrixFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderFilter.h" 9 | 10 | @interface DJILiveViewRenderColorMatrixFilter : DJILiveViewRenderFilter 11 | { 12 | GLint colorMatrixUniform; 13 | GLint intensityUniform; 14 | } 15 | 16 | /** A 4x4 matrix used to transform each color in an image 17 | */ 18 | @property(readwrite, nonatomic) DJIGPUMatrix4x4 colorMatrix; 19 | 20 | /** The degree to which the new transformed color replaces the original color for each pixel 21 | */ 22 | @property(readwrite, nonatomic) CGFloat intensity; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ColorMatrixFilter/DJILiveViewRenderColorMatrixFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderColorMatrixFilter.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderCommon.h" 9 | #import "DJILiveViewRenderColorMatrixFilter.h" 10 | 11 | NSString *const kDJIGPUImageColorMatrixFragmentShaderString = SHADER_STRING 12 | ( 13 | varying highp vec2 textureCoordinate; 14 | 15 | uniform sampler2D inputImageTexture; 16 | 17 | uniform lowp mat4 colorMatrix; 18 | uniform lowp float intensity; 19 | 20 | void main() 21 | { 22 | lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); 23 | lowp vec4 outputColor = textureColor * colorMatrix; 24 | 25 | gl_FragColor = (intensity * outputColor) + ((1.0 - intensity) * textureColor); 26 | } 27 | ); 28 | 29 | 30 | @implementation DJILiveViewRenderColorMatrixFilter 31 | 32 | @synthesize intensity = _intensity; 33 | @synthesize colorMatrix = _colorMatrix; 34 | 35 | -(id) initWithContext:(DJILiveViewRenderContext *)acontext{ 36 | if (self = [super initWithContext:acontext 37 | fragmentShaderFromString:kDJIGPUImageColorMatrixFragmentShaderString]) { 38 | 39 | } 40 | 41 | colorMatrixUniform = [filterProgram uniformIndex:@"colorMatrix"]; 42 | intensityUniform = [filterProgram uniformIndex:@"intensity"]; 43 | 44 | self.intensity = 1.f; 45 | self.colorMatrix = (DJIGPUMatrix4x4){ 46 | {1.f, 0.f, 0.f, 0.f}, 47 | {0.f, 1.f, 0.f, 0.f}, 48 | {0.f, 0.f, 1.f, 0.f}, 49 | {0.f, 0.f, 0.f, 1.f} 50 | }; 51 | 52 | return self; 53 | } 54 | 55 | #pragma mark - 56 | #pragma mark Accessors 57 | 58 | - (void)setIntensity:(CGFloat)newIntensity; 59 | { 60 | _intensity = newIntensity; 61 | 62 | [self setFloat:_intensity forUniform:intensityUniform program:filterProgram]; 63 | } 64 | 65 | - (void)setColorMatrix:(DJIGPUMatrix4x4)newColorMatrix; 66 | { 67 | _colorMatrix = newColorMatrix; 68 | 69 | [self setMatrix4f:_colorMatrix forUniform:colorMatrixUniform program:filterProgram]; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ColorMonitor/DJILiveViewColorMonitorFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewColorMonitorFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderFilter.h" 9 | 10 | 11 | typedef enum : NSUInteger { 12 | DJILiveViewColorMonitorRenderModeHistgram, //Based on histogram generation 13 | DJILiveViewColorMonitorRenderModeLines, //Generate based on color lines 14 | } DJILiveViewColorMonitorRenderMode; 15 | 16 | typedef enum : NSUInteger { 17 | DJILiveViewColorMonitorDisplayTypeCombine =0, //Merge display 18 | DJILiveViewColorMonitorDisplayTypeSeparate =1, //Split display 19 | DJILiveViewColorMonitorDisplayTypeYChannel = 2, //brightness 20 | } DJILiveViewColorMonitorDisplayType; 21 | 22 | /* 23 | * Color oscilloscope, due to the need for histogram operation, using buffered rendering to the CPU for processing 24 | */ 25 | @interface DJILiveViewColorMonitorFilter : DJILiveViewRenderFilter 26 | 27 | //image output, can be changed, for RKVO 28 | @property (nonatomic, strong) UIView* renderedColorWaveFormView; 29 | 30 | //render mode 31 | @property (nonatomic, assign) DJILiveViewColorMonitorRenderMode renderMode; 32 | @property (nonatomic, assign) DJILiveViewColorMonitorDisplayType displayType; 33 | 34 | // default 2 35 | @property(readwrite, nonatomic) CGFloat intensity; 36 | 37 | //blend mode for line drawing rander method 38 | @property (readwrite, nonatomic) CGBlendMode lineBlendMode; 39 | 40 | @property (nonatomic, assign) float colorMonitorScaleFactor; 41 | @end 42 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ColorSpaceFilter/DJILiveViewColorSpaceFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewColorSpaceFilter.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJILiveViewColorSpaceFilter_h 9 | #define DJILiveViewColorSpaceFilter_h 10 | 11 | #import 12 | 13 | typedef NS_ENUM(NSUInteger,DJILiveViewColorSpaceFilterType){ 14 | DJILiveViewColorSpaceFilterType_Y = 1 << 0, 15 | DJILiveViewColorSpaceFilterType_U = 1 << 1, 16 | DJILiveViewColorSpaceFilterType_V = 1 << 2, 17 | DJILiveViewColorSpaceFilterType_UV = 1 << 3, 18 | DJILiveViewColorSpaceFilterType_RGBA = 1 << 4, 19 | }; 20 | 21 | enum{ 22 | DJIColorSpace420PCombinedType = (DJILiveViewColorSpaceFilterType_Y | DJILiveViewColorSpaceFilterType_U | DJILiveViewColorSpaceFilterType_V), 23 | DJIColorSpace420PBiCombinedType = (DJILiveViewColorSpaceFilterType_Y | DJILiveViewColorSpaceFilterType_UV), 24 | }; 25 | 26 | @interface DJILiveViewColorSpaceFilter : DJILiveViewRenderFilter 27 | 28 | - (id)initWithContext:(DJILiveViewRenderContext*)context 29 | andColorSpaceType:(DJILiveViewColorSpaceFilterType)type; 30 | 31 | @end 32 | 33 | #endif /* DJILiveViewColorSpaceFilter_h */ 34 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/HSBFilter/DJILiveViewRenderHSBFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderHSBFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import "DJILiveViewRenderColorMatrixFilter.h" 8 | 9 | //copy from gpuimage hsb filter 10 | @interface DJILiveViewRenderHSBFilter : DJILiveViewRenderColorMatrixFilter 11 | 12 | /** Reset the filter to have no transformations. 13 | */ 14 | - (void)reset; 15 | 16 | /** Add a hue rotation to the filter. 17 | The hue rotation is in the range [-360, 360] with 0 being no-change. 18 | Note that this adjustment is additive, so use the reset method if you need to. 19 | */ 20 | @property (nonatomic, assign) float rotateHue; 21 | 22 | /** Add a saturation adjustment to the filter. 23 | The saturation adjustment is in the range [0.0, 2.0] with 1.0 being no-change. 24 | Note that this adjustment is additive, so use the reset method if you need to. 25 | */ 26 | @property (nonatomic, assign) float saturation; 27 | 28 | /** Add a brightness adjustment to the filter. 29 | The brightness adjustment is in the range [0.0, 2.0] with 1.0 being no-change. 30 | Note that this adjustment is additive, so use the reset method if you need to. 31 | */ 32 | @property (nonatomic, assign) float brightness; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/HighLightShadowFilter/DJILiveViewRenderHighlightShadowFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderHighlightShadowFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderFilter.h" 9 | 10 | /* 11 | * Reduced highlights, shadow highlights 12 | */ 13 | @interface DJILiveViewRenderHighlightShadowFilter : DJILiveViewRenderFilter 14 | 15 | /** 16 | * 0 - 1, increase to lighten shadows. 17 | * @default 0 18 | */ 19 | @property(readwrite, nonatomic) CGFloat shadowsLighten; 20 | 21 | /** 22 | * 0 - 1, increase to darken highlights. 23 | * @default 0 24 | */ 25 | @property(readwrite, nonatomic) CGFloat highlightsDecrease; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/HighLightShadowFilter/DJILiveViewRenderHighlightShadowFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderHighlightShadowFilter.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderCommon.h" 9 | #import "DJILiveViewRenderHighlightShadowFilter.h" 10 | 11 | NSString *const kHighlightShadowFragmentShaderString = SHADER_STRING 12 | ( 13 | uniform sampler2D inputImageTexture; 14 | varying highp vec2 textureCoordinate; 15 | 16 | uniform lowp float shadows; 17 | uniform lowp float highlights; 18 | 19 | const mediump vec3 luminanceWeighting = vec3(0.3, 0.3, 0.3); 20 | 21 | void main() 22 | { 23 | lowp vec4 source = texture2D(inputImageTexture, textureCoordinate); 24 | mediump float luminance = dot(source.rgb, luminanceWeighting); 25 | 26 | mediump float shadow = clamp((pow(luminance, 1.0/(shadows+1.0)) + (-0.76)*pow(luminance, 2.0/(shadows+1.0))) - luminance, 0.0, 1.0); 27 | mediump float highlight = clamp((1.0 - (pow(1.0-luminance, 1.0/(2.0-highlights)) + (-0.8)*pow(1.0-luminance, 2.0/(2.0-highlights)))) - luminance, -1.0, 0.0); 28 | lowp vec3 result = vec3(0.0, 0.0, 0.0) + ((luminance + shadow + highlight) - 0.0) * ((source.rgb - vec3(0.0, 0.0, 0.0))/(luminance - 0.0)); 29 | 30 | gl_FragColor = vec4(result.rgb, source.a); 31 | } 32 | ); 33 | 34 | @implementation DJILiveViewRenderHighlightShadowFilter 35 | 36 | -(id) initWithContext:(DJILiveViewRenderContext *)acontext{ 37 | self = [super initWithContext:acontext fragmentShaderFromString:kHighlightShadowFragmentShaderString]; 38 | 39 | //set default value 40 | _highlightsDecrease = -1; 41 | _shadowsLighten = -1; 42 | 43 | self.highlightsDecrease = 0; 44 | self.shadowsLighten = 0; 45 | return self; 46 | } 47 | 48 | -(void) setShadowsLighten:(CGFloat)shadowsLighten{ 49 | if (shadowsLighten == _shadowsLighten) { 50 | return; 51 | } 52 | 53 | _shadowsLighten = shadowsLighten; 54 | [self setFloat:_shadowsLighten forUniformName:@"shadows"]; 55 | } 56 | 57 | -(void) setHighlightsDecrease:(CGFloat)highlightsDecrease{ 58 | if (highlightsDecrease == _highlightsDecrease) { 59 | return; 60 | } 61 | 62 | _highlightsDecrease = highlightsDecrease; 63 | [self setFloat:(1.0 - _highlightsDecrease) forUniformName:@"highlights"]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/LookupFilter/DJILiveViewRenderLookupFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderLookupFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderTexture.h" 9 | #import "DJILiveViewRenderFilter.h" 10 | 11 | //from GPUImage lookup filter 12 | @interface DJILiveViewRenderLookupFilter : DJILiveViewRenderFilter 13 | 14 | -(id) initWithContext:(DJILiveViewRenderContext *)context 15 | lookupTexture:(DJILiveViewRenderTexture *)texture; 16 | 17 | @property (nonatomic, assign) CGFloat intensity; 18 | @property (nonatomic, strong) DJILiveViewRenderTexture* lookupTexture; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ReversDLogLookup/DJIReverseDLogFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIReverseDLogFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJIStreamCommon.h" 9 | #import "DJILiveViewRenderLookupFilter.h" 10 | 11 | @interface DJIReverseDLogFilter : DJILiveViewRenderLookupFilter 12 | 13 | -(id) initWithContext:(DJILiveViewRenderContext *)context; 14 | 15 | /* 16 | * the type of lut, it may different on diffent platform 17 | */ 18 | @property (nonatomic, assign) DLogReverseLookupTableType lutType; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ReversDLogLookup/DJIReverseDLogFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJIReverseDLogFilter.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJIReverseDLogFilter.h" 9 | 10 | @implementation DJIReverseDLogFilter 11 | 12 | -(id) initWithContext:(DJILiveViewRenderContext *)acontext{ 13 | 14 | //load texture for reverse dlog 15 | 16 | 17 | if (self = [super initWithContext:acontext 18 | lookupTexture:nil]) { 19 | self.lutType = DLogReverseLookupTableTypeDefault; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | -(void) setLutType:(DLogReverseLookupTableType)lutType{ 26 | if(_lutType == lutType) 27 | return; 28 | 29 | _lutType = lutType; 30 | self.lookupTexture = [self lutForType:_lutType]; 31 | } 32 | 33 | -(DJILiveViewRenderTexture*) lutForType:(DLogReverseLookupTableType)lut{ 34 | NSString* lutName = [DJIReverseDLogFilter imageNameWithLUTType:lut]; 35 | DJILiveViewRenderTexture* texture = nil; 36 | 37 | if (lutName) { 38 | UIImage* lookupTexture = [UIImage imageNamed:lutName]; 39 | texture = [[DJILiveViewRenderTexture alloc] 40 | initWithContext:context 41 | image:lookupTexture]; 42 | } 43 | 44 | return texture; 45 | } 46 | 47 | +(NSString*) imageNameWithLUTType:(DLogReverseLookupTableType)type{ 48 | static NSDictionary* lutDic = nil; 49 | static dispatch_once_t onceToken; 50 | dispatch_once(&onceToken, ^{ 51 | lutDic = @{ 52 | @(DLogReverseLookupTableTypeDefault) 53 | :@"p4p_dlog_lut_new", 54 | 55 | @(DLogReverseLookupTableP4POld) 56 | :@"p4p_dlog_lut_old", 57 | }; 58 | }); 59 | 60 | return lutDic[@(type)]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/ScaleFilter/DJILiveViewRenderScaleFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderScaleFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | #import "DJILiveViewRenderFilter.h" 10 | 11 | /* 12 | * a filter to upscale or downscale image in aspect fit mode 13 | * rotation is not supported 14 | */ 15 | @interface DJILiveViewRenderScaleFilter : DJILiveViewRenderFilter 16 | 17 | //the size that need capture data 18 | @property (nonatomic, assign) CGSize targetSize; 19 | @end 20 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/SobelFilter/DJILiveViewRenderFocusWarningFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderFocusWarningFilter.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderFilter.h" 9 | 10 | @interface DJILiveViewRenderFocusWarningFilter : DJILiveViewRenderFilter 11 | 12 | -(id) initWithContext:(id)context; 13 | 14 | @property (nonatomic, assign) CGFloat focusWarningThreshold; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Texture/DJILiveViewRenderPicutre.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderPicutre.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderFilter.h" 9 | 10 | @interface DJILiveViewRenderPicutre : DJILiveViewRenderFilter 11 | 12 | -(id) initWithContext:(DJILiveViewRenderContext *)context 13 | picture:(UIImage*)image; 14 | 15 | -(void) render; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Texture/DJILiveViewRenderPicutre.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderPicutre.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import "DJILiveViewRenderPicutre.h" 9 | #import "DJILiveViewRenderTexture.h" 10 | 11 | @interface DJILiveViewRenderPicutre () 12 | @property (nonatomic, strong) DJILiveViewRenderTexture* texture; 13 | @end 14 | 15 | @implementation DJILiveViewRenderPicutre 16 | 17 | -(id) initWithContext:(DJILiveViewRenderContext *)acontext picture:(UIImage *)image{ 18 | self = [super initWithContext:acontext]; 19 | _texture = [[DJILiveViewRenderTexture alloc] initWithContext:acontext image:image]; 20 | inputTextureSize = [_texture pixelSizeOfImage]; 21 | return self; 22 | } 23 | 24 | -(void) render{ 25 | [self newFrameReadyAtTime:kCMTimeZero atIndex:0]; 26 | } 27 | 28 | - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates; 29 | { 30 | if (self.preventRendering) 31 | { 32 | return; 33 | } 34 | 35 | [context setContextShaderProgram:filterProgram]; 36 | CGSize FBOSize = [self sizeOfFBO]; 37 | 38 | if (outputFramebuffer == nil 39 | || NO == CGSizeEqualToSize(FBOSize, self.framebufferForOutput.size)) { 40 | outputFramebuffer = [[DJILiveViewFrameBuffer alloc] 41 | initWithContext:context 42 | size:FBOSize 43 | textureOptions:self.outputTextureOptions 44 | onlyTexture:NO]; 45 | } 46 | 47 | [outputFramebuffer activateFramebuffer]; 48 | 49 | [self setUniformsForProgramAtIndex:0]; 50 | glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); 51 | glClear(GL_COLOR_BUFFER_BIT); 52 | 53 | glActiveTexture(GL_TEXTURE2); 54 | glBindTexture(GL_TEXTURE_2D, [_texture texture]); 55 | 56 | glUniform1i(filterInputTextureUniform, 2); 57 | glEnableVertexAttribArray(filterPositionAttribute); 58 | glEnableVertexAttribArray(filterTextureCoordinateAttribute); 59 | glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); 60 | glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); 61 | 62 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 63 | } 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Texture/DJILiveViewRenderTexture.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderTexture.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | #import 9 | #import "DJILiveViewFrameBuffer.h" 10 | 11 | // single texture object 12 | @interface DJILiveViewRenderTexture : NSObject 13 | -(id) initWithContext:(id)context 14 | image:(UIImage*)image; 15 | 16 | -(id) initWithContext:(id)context 17 | cgImage:(CGImageRef)image; 18 | 19 | -(id) initWithContext:(id)context 20 | cgImage:(CGImageRef)image 21 | option:(DJILiveViewRenderTextureOptions)option; 22 | 23 | //output 24 | -(GLuint) texture; 25 | 26 | //info 27 | @property (nonatomic, readonly) CGSize pixelSizeOfImage; 28 | @property (nonatomic, readonly) DJILiveViewRenderTextureOptions textureOptions; 29 | @end 30 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Upload/DJILiveViewRenderDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderDataSource.h 3 | // 4 | 5 | #import "DJIStreamCommon.h" 6 | #import "DJILiveViewRenderPass.h" 7 | 8 | 9 | //provide fast upload and YUV convert from decoder 10 | @interface DJILiveViewRenderDataSource : DJILiveViewRenderPass 11 | 12 | // rotation of the preview content 13 | @property (assign, nonatomic) VideoStreamRotationType rotation; 14 | 15 | //render the view with grayscale 16 | @property (assign, nonatomic) BOOL grayScale; 17 | 18 | //scale on output luminance 19 | @property (assign, nonatomic) float luminanceScale; 20 | 21 | -(id) initWithContext:(DJILiveViewRenderContext *)context; 22 | 23 | -(void) loadFrame:(VideoFrameYUV*)frame; 24 | 25 | -(void) renderPass; 26 | 27 | -(void) renderBlack; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoPreviewer/Render/Upload/DJILiveViewRenderDataSource_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJILiveViewRenderDataSource_Private.h 3 | // DJIWidget 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | #ifndef DJILiveViewRenderDataSource_Private_h 9 | #define DJILiveViewRenderDataSource_Private_h 10 | 11 | #import 12 | 13 | @interface DJILiveViewRenderDataSource (){ 14 | 15 | BOOL _inputLoaded; 16 | VPFrameType _lastFrameType; 17 | 18 | GLuint _inputWidth; 19 | GLuint _inputHeight; 20 | GLuint _inputWidthRGB; 21 | GLuint _inputHeightRGB; 22 | 23 | GLuint _outputWidth; 24 | GLuint _outputHeight; 25 | 26 | GLuint positionAttribute; 27 | GLuint textureCoordinateAttribute; 28 | 29 | GLuint textureUniforms[3]; 30 | GLuint uniformYUVMatrix; 31 | GLuint luminanceScaleUniform; 32 | 33 | GLuint textureInputRGB; 34 | GLuint textureInput[3]; 35 | GLuint textureInputFastupload[3]; 36 | CVOpenGLESTextureRef fastuploadCVRef[3]; 37 | 38 | BOOL isFullRange; 39 | } 40 | 41 | @property (nonatomic, strong) DJILiveViewRenderProgram* programBiYUV; 42 | @property (nonatomic, strong) DJILiveViewRenderProgram* programYUV; 43 | @property (nonatomic, strong) DJILiveViewRenderProgram* programRGBA; 44 | @property (nonatomic, strong) DJILiveViewRenderProgram* activeProgram; 45 | 46 | @end 47 | 48 | #endif /* DJILiveViewRenderDataSource_Private_h */ 49 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/DJIVTH264DecoderIFrameData.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVTH264DecoderIFrameData.h 3 | // 4 | // Copyright (c) 2013 DJI. All rights reserved. 5 | // 6 | 7 | #ifndef DJIVTH264DecoderIFrameData_h 8 | #define DJIVTH264DecoderIFrameData_h 9 | #import "DJIVideoHelper.h" 10 | 11 | extern int loadPrebuildIframePrivate(uint8_t* buffer, int in_buffer_size, PrebuildIframeInfo info); 12 | 13 | #endif /* DJIVTH264DecoderIFrameData_h */ 14 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/DJIWidgetAsyncCommandQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIWidgetAsyncCommandQueue.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | /** 8 | * Asynchronous command queue whose behavior is similar to NSRunLoop. 9 | */ 10 | #import 11 | 12 | typedef enum : NSUInteger { 13 | DJIAsyncCommandObjectWork_Initial, //Not yet executed 14 | DJIAsyncCommandObjectWork_Normal, //Normal Execution 15 | DJIAsyncCommandObjectWork_NeedCancel, //Canceled 16 | } DJIAsyncCommandObjectWorkHint; 17 | 18 | /** 19 | Command execution ordering options. 20 | */ 21 | typedef enum : NSUInteger { 22 | DJIAsyncCommandOption_FIFO = 0, 23 | DJIAsyncCommandOption_LIFO = 1<<0, 24 | DJIAsyncCommandOption_RemoveSameTag = 1<<1, 25 | } DJIAsyncCommandOption; 26 | 27 | typedef void(^DJIWidgetAsyncCommandQueueOperation)(DJIAsyncCommandObjectWorkHint hint); 28 | 29 | @interface DJIAsyncCommandObject : NSObject 30 | 31 | @property (nonatomic, assign) BOOL alwaysNeedCallback; 32 | 33 | @property (nonatomic, copy) DJIWidgetAsyncCommandQueueOperation _Nullable workBlock; 34 | 35 | @property (nonatomic, readonly) NSObject* _Nullable tag; 36 | 37 | @property (nonatomic, readonly) NSDate* _Nullable runAfterDate; 38 | 39 | +(instancetype _Nonnull) commandWithTag:(NSObject* _Nullable)tag 40 | block:(DJIWidgetAsyncCommandQueueOperation _Nullable)work; 41 | 42 | +(instancetype _Nonnull) commandWithTag:(NSObject* _Nullable)tag 43 | afterDate:(NSDate* _Nullable)date 44 | block:(DJIWidgetAsyncCommandQueueOperation _Nullable)work; 45 | @end 46 | 47 | @interface DJIWidgetAsyncCommandQueue : NSObject 48 | 49 | 50 | -(id _Nonnull) initWithThreadSafe:(BOOL)threadSafe; 51 | 52 | -(void) pushCommand:(DJIAsyncCommandObject* _Nonnull)command withOption:(DJIAsyncCommandOption)optionFlag; 53 | 54 | -(void) cancelCommandWithTag:(NSObject* _Nullable)tag; 55 | 56 | -(void) cancelCommandWithTags:(NSArray* _Nullable)tags; 57 | 58 | -(void) runloop; 59 | 60 | -(void) runloopWithTimeOutMS:(int)timeoutMs; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/DJIWidgetLinkQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIWidgetLinkQueue.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | /** 13 | * Threadsafe circular queue 14 | */ 15 | @interface DJIWidgetLinkQueue : NSObject 16 | 17 | - (id)initWithSize:(int)size; 18 | 19 | - (void)clear; 20 | 21 | - (int)count; 22 | 23 | - (int)size; 24 | 25 | - (BOOL)push:(uint8_t *)buf length:(int)len; 26 | 27 | - (uint8_t *)pull:(int *)len; 28 | 29 | - (bool)isFull; 30 | 31 | - (void)wakeupReader; 32 | 33 | - (uint8_t *)getHeaderOfQueue; 34 | 35 | @end 36 | 37 | @interface DJIObjectLinkQueue : NSObject 38 | 39 | - (id)initWithSize:(int)size; 40 | 41 | - (void)clear; 42 | 43 | - (int)count; 44 | 45 | - (int)size; 46 | 47 | - (BOOL)push:(id)object; 48 | 49 | - (_Nullable id)pull; 50 | 51 | - (bool)isFull; 52 | 53 | - (void)wakeupReader; 54 | 55 | - (_Nullable id)getHeaderOfQueue; 56 | 57 | @end 58 | 59 | NS_ASSUME_NONNULL_END 60 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/DJIWidgetMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIWidgetMacros.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #ifndef DJIWidgetMacros_h 8 | #define DJIWidgetMacros_h 9 | 10 | #define BEGIN_DISPATCH_QUEUE dispatch_async(_dispatchQueue, ^{ 11 | #define END_DISPATCH_QUEUE }); 12 | 13 | #define BEGIN_MAIN_DISPATCH_QUEUE dispatch_async(dispatch_get_main_queue(), ^{ 14 | 15 | #define weakSelf(__TARGET__) __weak typeof(self) __TARGET__=self 16 | #define strongSelf(__TARGET__, __WEAK__) typeof(self) __TARGET__=__WEAK__ 17 | #ifdef weakReturn 18 | #undef weakReturn 19 | #endif 20 | #define weakReturn(__TARGET__) __strong typeof(__TARGET__) __strong##__TARGET__ = __TARGET__; \ 21 | if(__strong##__TARGET__==nil)return; 22 | 23 | #define SAFE_BLOCK(block, ...) if(block){block(__VA_ARGS__);} 24 | 25 | #define DJILOG(fmt, ...) 26 | 27 | #endif /* VideoPreviewerMacros_h */ 28 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/H1Camera/DJICameraRemotePlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJICameraRemotePlayerView.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | 10 | @interface DJICameraRemotePlayerView : UIView 11 | 12 | -(id) initWithPlayerLayer:(AVPlayerLayer*)layer; 13 | 14 | -(void) reDraw; 15 | @end 16 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/H1Camera/DJICameraRemotePlayerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DJICameraRemotePlayerView.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import "DJICameraRemotePlayerView.h" 8 | 9 | @interface DJICameraRemotePlayerView () 10 | @property (nonatomic, strong) AVPlayerLayer* playerLayer; 11 | @end 12 | 13 | @implementation DJICameraRemotePlayerView 14 | 15 | -(id) initWithPlayerLayer:(AVPlayerLayer *)layer{ 16 | if (self = [super initWithFrame:layer.frame]) { 17 | self.playerLayer = layer; 18 | [self.layer addSublayer:layer]; 19 | } 20 | return self; 21 | } 22 | 23 | -(void) layoutSubviews{ 24 | [super layoutSubviews]; 25 | 26 | _playerLayer.frame = self.layer.bounds; 27 | } 28 | 29 | -(void) reDraw{ 30 | 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/H1Camera/DJIRTPlayerRenderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIRTPlayerRenderView.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import "DJICameraRemotePlayerView.h" 8 | #import "DJIStreamCommon.h" 9 | #import "DJIVideoHelper.h" 10 | 11 | 12 | typedef NS_ENUM(NSInteger,LiveStreamDecodeType) { 13 | LiveStreamDecodeType_Software = 0, //Default 14 | LiveStreamDecodeType_VTHardware = 1, 15 | }; 16 | 17 | @protocol FPSControlDelegate 18 | @optional 19 | ///< for just decode ,=0 no need to sleep, >0 sleep time 20 | -(double)frameSleepTime; 21 | @end 22 | 23 | @interface DJIRTPlayerRenderView : DJICameraRemotePlayerView 24 | 25 | //rotation 26 | @property (assign, nonatomic) VideoStreamRotationType rotation; 27 | @property (assign, nonatomic) H264EncoderType encoderType; 28 | 29 | -(id) initWithDecoderType:(LiveStreamDecodeType)decodeType 30 | encoderType:(H264EncoderType)encoderType; 31 | 32 | -(void) decodeH264CompleteFrameData:(uint8_t*)data 33 | length:(NSUInteger)size 34 | decodeOnly:(BOOL)decodeOnly; 35 | 36 | //return YES if contains a frame 37 | -(BOOL) decodeH264RawData:(uint8_t*)data 38 | length:(NSUInteger)size; 39 | 40 | -(void) reDraw; 41 | -(void) reDrawWithGrayout:(BOOL)gray; 42 | 43 | /** 44 | * Screen capture of the current view 45 | */ 46 | -(void) snapshotPreview:(void(^)(UIImage* snapshot))block; 47 | 48 | @property (nonatomic,weak) id delegate ; 49 | @end 50 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/DJIVTH264CompressConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVTH264CompressConfiguration.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | 9 | extern const NSUInteger kDefaultFrameRate; 10 | 11 | //Usage type 12 | typedef NS_ENUM(NSUInteger, DJIVTH264CompressConfigurationUsageType) { 13 | DJIVTH264CompressConfigurationUsageTypeLocalRecord, 14 | DJIVTH264CompressConfigurationUsageTypeLiveStream, 15 | DJIVTH264CompressConfigurationUsageTypeQuickMovie, 16 | }; 17 | 18 | 19 | 20 | @interface DJIVTH264CompressConfiguration : NSObject 21 | 22 | - (instancetype)initWithUsageType:(DJIVTH264CompressConfigurationUsageType)usageType; 23 | 24 | - (void)setStreamFrameRate:(NSUInteger)frameRate; 25 | 26 | - (NSDictionary *)configDict; 27 | 28 | - (NSUInteger)configFrameRate; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/DJIVTH264CompressSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVTH264CompressSession.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIVTH264CompressConfiguration.h" 9 | #import 10 | 11 | 12 | 13 | 14 | @class DJIVTH264CompressSession; 15 | 16 | 17 | @protocol DJIVTH264CompressSessionDelegate 18 | 19 | @required 20 | 21 | - (void)vth264compressSession:(DJIVTH264CompressSession *)session 22 | didCompressWithSampleBuffer:(CMSampleBufferRef)sampleBuffer 23 | status:(OSStatus)status; 24 | 25 | 26 | @end 27 | 28 | 29 | @interface DJIVTH264CompressSession : NSObject 30 | 31 | @property (nonatomic, weak) id delegate; 32 | @property (nonatomic, assign, readonly) int width; 33 | @property (nonatomic, assign, readonly) int height; 34 | @property (nonatomic, assign, readonly) BOOL isPrepared; 35 | 36 | - (instancetype)initWithWidth:(int)width height:(int)height; 37 | - (BOOL)prepareEncode; 38 | 39 | - (OSStatus)encodeWithCVPixelBuffer:(CVPixelBufferRef)imageBuffer 40 | presentationTime:(CMTime)presentationTimeStamp 41 | duration:(CMTime)duration 42 | sourceFrameRefCon:(void *)sourceFrameRefCon 43 | shouldRelease:(BOOL)released; 44 | 45 | - (void)setupWithConfig:(DJIVTH264CompressConfiguration *)config; 46 | @end 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/DJIVTH264Compressor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVTH264Compressor.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import 9 | #import "DJIVTH264CompressConfiguration.h" 10 | 11 | 12 | typedef NS_ENUM(NSUInteger, DJIVTH264CompressorStatus) { 13 | DJIVTH264CompressorStatusIdel, 14 | DJIVTH264CompressorStatusReady, 15 | DJIVTH264CompressorStatusFailed, 16 | }; 17 | 18 | 19 | @interface DJIVTH264Compressor : NSObject 20 | 21 | @property (nonatomic, strong, readonly) NSData* sps; 22 | @property (nonatomic, strong, readonly) NSData* pps; 23 | 24 | 25 | @property (nonatomic, readonly) DJIVTH264CompressorStatus status; 26 | 27 | @property (nonatomic, assign) NSTimeInterval configFrameRate; 28 | 29 | @property (nonatomic, copy) void (^encodeOutput)(VideoFrameH264Raw* frame, NSError* error); 30 | 31 | // setup vtCompressSession 32 | - (BOOL)setupCompressSessionWithWidth:(int)width height:(int)height rotate:(int)rotate compressConfig:(DJIVTH264CompressConfiguration *)config; 33 | 34 | - (BOOL)encodePixelBuffer:(CVPixelBufferRef)pixelBuffer shouldReleased:(BOOL)released; 35 | 36 | // complete all frames and reset to idel status 37 | - (void)reset; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/DJIVTH264Encoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJIVTH264Encoder.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | #import 8 | #import "DJIVTH264CompressConfiguration.h" 9 | #import "DJIVideoPoolStructs.h" 10 | #import "DJIVTH264Compressor.h" 11 | 12 | 13 | @class DJIVTH264Encoder; 14 | 15 | @protocol DJIVTH264EncoderOutput 16 | 17 | @required 18 | 19 | - (BOOL)vtH264Encoder:(DJIVTH264Encoder *)encoder output:(VideoFrameH264Raw *)packet; 20 | 21 | @end 22 | 23 | 24 | @interface DJIVTH264Encoder : NSObject 25 | 26 | @property (nonatomic, weak) id delegate; 27 | @property (nonatomic, assign) BOOL enabled; 28 | @property (nonatomic, strong, readonly) NSData* currentSps; 29 | @property (nonatomic, strong, readonly) NSData* currentPps; 30 | @property (nonatomic, assign, readonly) NSUInteger inputVideoFrameNum; 31 | @property (nonatomic, assign, readonly) NSUInteger outputVideoFrameNum; 32 | 33 | @property (nonatomic, assign) DJIVideoStreamBasicInfo streamInfo; 34 | 35 | - (instancetype)initWithConfig:(DJIVTH264CompressConfiguration *)config delegate:(id )delegate; 36 | 37 | - (void)invalidate; 38 | 39 | 40 | #pragma mark - Input 41 | 42 | - (void)pushVideoFrame:(VideoFrameYUV*)frame; 43 | 44 | - (void)pushAudioPacket:(AudioFrameAACRaw*)packet; 45 | 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/NSError+DJIVTH264CompressSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+DJIVTH264CompressSession.h 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | #import 7 | 8 | 9 | extern NSString * const DJIVTH264CompressSessionErrorDomain; 10 | 11 | 12 | @interface NSError (DJIVTH264CompressSession) 13 | 14 | + (NSError *)videoToolboxErrorWithStatus:(OSStatus)status; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DJIWidget/DJIWidget/VideoService/VTH264Encoder/NSError+DJIVTH264CompressSession.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+DJIVTH264CompressSession.m 3 | // 4 | // Copyright (c) 2017 DJI. All rights reserved. 5 | // 6 | 7 | 8 | 9 | #import 10 | #import "NSError+DJIVTH264CompressSession.h" 11 | 12 | 13 | NSString * const DJIVTH264CompressSessionErrorDomain = @"DJIVTH264CompressSessionErrorDomain"; 14 | 15 | 16 | static NSString * DescriptionWithStatus(OSStatus status){ 17 | switch(status) { 18 | case kVTPropertyNotSupportedErr: 19 | return @"Property Not Supported"; 20 | default: 21 | return [NSString stringWithFormat:@"Video Toolbox Error: %d", (int)status]; 22 | } 23 | } 24 | 25 | 26 | @implementation NSError (DJIVTH264CompressSession) 27 | 28 | + (NSError *)videoToolboxErrorWithStatus:(OSStatus)status { 29 | NSDictionary* userInfo = @{NSLocalizedDescriptionKey:DescriptionWithStatus(status)}; 30 | return [NSError errorWithDomain:DJIVTH264CompressSessionErrorDomain code:(NSInteger)status userInfo:userInfo]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/FFmpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/DJIWidget/FFmpeg/FFmpeg.framework/FFmpeg -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/FFmpeg.h: -------------------------------------------------------------------------------- 1 | // 2 | // FFmpeg.h 3 | // FFmpeg 4 | // 5 | // Copyright © 2018 DJI. All rights reserved. 6 | // 7 | 8 | 9 | #import 10 | 11 | //! Project version number for FFmpeg. 12 | FOUNDATION_EXPORT double FFmpegVersionNumber; 13 | 14 | //! Project version string for FFmpeg. 15 | FOUNDATION_EXPORT const unsigned char FFmpegVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import 20 | 21 | #import "libavformat/avformat.h" 22 | #import "libswscale/swscale.h" 23 | #import "libavcodec/avcodec.h" 24 | #import "libavutil/avutil.h" 25 | #import "libswresample/swresample.h" 26 | #import "libavresample/avresample.h" 27 | #import "libavfilter/avfilter.h" 28 | #import "libavdevice/avdevice.h" 29 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 56 31 | #define LIBAVDEVICE_VERSION_MINOR 3 32 | #define LIBAVDEVICE_VERSION_MICRO 100 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVDEVICE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavfilter/avfiltergraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filter graphs 3 | * copyright (c) 2007 Bobby Bingham 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVFILTER_AVFILTERGRAPH_H 23 | #define AVFILTER_AVFILTERGRAPH_H 24 | 25 | #include "avfilter.h" 26 | #include "libavutil/log.h" 27 | 28 | #endif /* AVFILTER_AVFILTERGRAPH_H */ 29 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVRESAMPLE_VERSION_H 20 | #define AVRESAMPLE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavr 25 | * Libavresample version macros. 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVRESAMPLE_VERSION_MAJOR 2 31 | #define LIBAVRESAMPLE_VERSION_MINOR 1 32 | #define LIBAVRESAMPLE_VERSION_MICRO 0 33 | 34 | #define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \ 35 | LIBAVRESAMPLE_VERSION_MINOR, \ 36 | LIBAVRESAMPLE_VERSION_MICRO) 37 | #define LIBAVRESAMPLE_VERSION AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \ 38 | LIBAVRESAMPLE_VERSION_MINOR, \ 39 | LIBAVRESAMPLE_VERSION_MICRO) 40 | #define LIBAVRESAMPLE_BUILD LIBAVRESAMPLE_VERSION_INT 41 | 42 | #define LIBAVRESAMPLE_IDENT "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #ifndef FF_API_RESAMPLE_CLOSE_OPEN 51 | #define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 3) 52 | #endif 53 | 54 | #endif /* AVRESAMPLE_VERSION_H */ 55 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_ADLER32_H 22 | #define AVUTIL_ADLER32_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @file 29 | * Public header for libavutil Adler32 hasher 30 | * 31 | * @defgroup lavu_adler32 Adler32 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Calculate the Adler32 checksum of a buffer. 38 | * 39 | * Passing the return value to a subsequent av_adler32_update() call 40 | * allows the checksum of multiple buffers to be calculated as though 41 | * they were concatenated. 42 | * 43 | * @param adler initial checksum value 44 | * @param buf pointer to input buffer 45 | * @param len size of input buffer 46 | * @return updated checksum 47 | */ 48 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 49 | unsigned int len) av_pure; 50 | 51 | /** 52 | * @} 53 | */ 54 | 55 | #endif /* AVUTIL_ADLER32_H */ 56 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_aes_size; 36 | 37 | struct AVAES; 38 | 39 | /** 40 | * Allocate an AVAES context. 41 | */ 42 | struct AVAES *av_aes_alloc(void); 43 | 44 | /** 45 | * Initialize an AVAES context. 46 | * @param key_bits 128, 192 or 256 47 | * @param decrypt 0 for encryption, 1 for decryption 48 | */ 49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * Encrypt or decrypt a buffer using a previously initialized context. 53 | * @param count number of 16 byte blocks 54 | * @param dst destination array, can be equal to src 55 | * @param src source array, can be equal to dst 56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 57 | * @param decrypt 0 for encryption, 1 for decryption 58 | */ 59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_AES_H */ 66 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/audioconvert.h: -------------------------------------------------------------------------------- 1 | 2 | #include "version.h" 3 | 4 | #if FF_API_AUDIOCONVERT 5 | #include "channel_layout.h" 6 | #endif 7 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple assert() macros that are a bit more flexible than ISO C assert(). 24 | * @author Michael Niedermayer 25 | */ 26 | 27 | #ifndef AVUTIL_AVASSERT_H 28 | #define AVUTIL_AVASSERT_H 29 | 30 | #include 31 | #include "avutil.h" 32 | #include "log.h" 33 | 34 | /** 35 | * assert() equivalent, that is always enabled. 36 | */ 37 | #define av_assert0(cond) do { \ 38 | if (!(cond)) { \ 39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \ 40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \ 41 | abort(); \ 42 | } \ 43 | } while (0) 44 | 45 | 46 | /** 47 | * assert() equivalent, that does not lie in speed critical code. 48 | * These asserts() thus can be enabled without fearing speedloss. 49 | */ 50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 51 | #define av_assert1(cond) av_assert0(cond) 52 | #else 53 | #define av_assert1(cond) ((void)0) 54 | #endif 55 | 56 | 57 | /** 58 | * assert() equivalent, that does lie in speed critical code. 59 | */ 60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 61 | #define av_assert2(cond) av_assert0(cond) 62 | #else 63 | #define av_assert2(cond) ((void)0) 64 | #endif 65 | 66 | #endif /* AVUTIL_AVASSERT_H */ 67 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0 7 | #endif /* AVUTIL_AVCONFIG_H */ 8 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | 33 | /** 34 | * Decode a base64-encoded string. 35 | * 36 | * @param out buffer for decoded data 37 | * @param in null-terminated input string 38 | * @param out_size size in bytes of the out buffer, must be at 39 | * least 3/4 of the length of in 40 | * @return number of bytes written, or a negative value in case of 41 | * invalid input 42 | */ 43 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 44 | 45 | /** 46 | * Encode data to base64 and null-terminate. 47 | * 48 | * @param out buffer for encoded data 49 | * @param out_size size in bytes of the out buffer (including the 50 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 51 | * @param in input buffer containing the data to encode 52 | * @param in_size size in bytes of the in buffer 53 | * @return out or NULL in case of error 54 | */ 55 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 56 | 57 | /** 58 | * Calculate the output size needed to base64-encode x bytes to a 59 | * null-terminated string. 60 | */ 61 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | #endif /* AVUTIL_BASE64_H */ 68 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/cast5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144 3 | * Copyright (c) 2014 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_CAST5_H 23 | #define AVUTIL_CAST5_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil CAST5 algorithm 31 | * @defgroup lavu_cast5 CAST5 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_cast5_size; 37 | 38 | struct AVCAST5; 39 | 40 | /** 41 | * Allocate an AVCAST5 context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVCAST5 *av_cast5_alloc(void); 45 | /** 46 | * Initialize an AVCAST5 context. 47 | * 48 | * @param ctx an AVCAST5 context 49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption 50 | * @param key_bits number of keybits: possible are 40,48,...,128 51 | */ 52 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits); 53 | 54 | /** 55 | * Encrypt or decrypt a buffer using a previously initialized context 56 | * 57 | * @param ctx an AVCAST5 context 58 | * @param dst destination array, can be equal to src 59 | * @param src source array, can be equal to dst 60 | * @param count number of 8 byte blocks 61 | * @param decrypt 0 for encryption, 1 for decryption 62 | */ 63 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count,int decrypt); 64 | /** 65 | * @} 66 | */ 67 | #endif /* AVUTIL_CAST5_H */ 68 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/ffversion.h: -------------------------------------------------------------------------------- 1 | #ifndef AVUTIL_FFVERSION_H 2 | #define AVUTIL_FFVERSION_H 3 | #define FFMPEG_VERSION "66c8733" 4 | #endif /* AVUTIL_FFVERSION_H */ 5 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | typedef struct AVLFG { 26 | unsigned int state[64]; 27 | int index; 28 | } AVLFG; 29 | 30 | void av_lfg_init(AVLFG *c, unsigned int seed); 31 | 32 | /** 33 | * Get the next random unsigned 32-bit number using an ALFG. 34 | * 35 | * Please also consider a simple LCG like state= state*1664525+1013904223, 36 | * it may be good enough and faster for your specific use case. 37 | */ 38 | static inline unsigned int av_lfg_get(AVLFG *c){ 39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 40 | return c->state[c->index++ & 63]; 41 | } 42 | 43 | /** 44 | * Get the next random unsigned 32-bit number using a MLFG. 45 | * 46 | * Please also consider av_lfg_get() above, it is faster. 47 | */ 48 | static inline unsigned int av_mlfg_get(AVLFG *c){ 49 | unsigned int a= c->state[(c->index-55) & 63]; 50 | unsigned int b= c->state[(c->index-24) & 63]; 51 | return c->state[c->index++ & 63] = 2*a*b+a+b; 52 | } 53 | 54 | /** 55 | * Get the next two numbers generated by a Box-Muller Gaussian 56 | * generator using the random numbers issued by lfg. 57 | * 58 | * @param out array where the two generated numbers are placed 59 | */ 60 | void av_bmg_get(AVLFG *lfg, double out[2]); 61 | 62 | #endif /* AVUTIL_LFG_H */ 63 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * @ingroup lavu 22 | * Utility Preprocessor macros 23 | */ 24 | 25 | #ifndef AVUTIL_MACROS_H 26 | #define AVUTIL_MACROS_H 27 | 28 | /** 29 | * @addtogroup preproc_misc Preprocessor String Macros 30 | * 31 | * String manipulation macros 32 | * 33 | * @{ 34 | */ 35 | 36 | #define AV_STRINGIFY(s) AV_TOSTRING(s) 37 | #define AV_TOSTRING(s) #s 38 | 39 | #define AV_GLUE(a, b) a ## b 40 | #define AV_JOIN(a, b) AV_GLUE(a, b) 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | #define AV_PRAGMA(s) _Pragma(#s) 47 | 48 | #endif /* AVUTIL_MACROS_H */ 49 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MD5_H 22 | #define AVUTIL_MD5_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_md5 MD5 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_md5_size; 36 | 37 | struct AVMD5; 38 | 39 | /** 40 | * Allocate an AVMD5 context. 41 | */ 42 | struct AVMD5 *av_md5_alloc(void); 43 | 44 | /** 45 | * Initialize MD5 hashing. 46 | * 47 | * @param ctx pointer to the function context (of size av_md5_size) 48 | */ 49 | void av_md5_init(struct AVMD5 *ctx); 50 | 51 | /** 52 | * Update hash value. 53 | * 54 | * @param ctx hash function context 55 | * @param src input data to update hash with 56 | * @param len input data length 57 | */ 58 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 59 | 60 | /** 61 | * Finish hashing and output digest value. 62 | * 63 | * @param ctx hash function context 64 | * @param dst buffer where output digest value is stored 65 | */ 66 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 67 | 68 | /** 69 | * Hash an array of data. 70 | * 71 | * @param dst The output buffer to write the digest into 72 | * @param src The data to hash 73 | * @param len The length of the data, in bytes 74 | */ 75 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | #endif /* AVUTIL_MD5_H */ 82 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/motion_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_MOTION_VECTOR_H 20 | #define AVUTIL_MOTION_VECTOR_H 21 | 22 | #include 23 | 24 | typedef struct AVMotionVector { 25 | /** 26 | * Where the current macroblock comes from; negative value when it comes 27 | * from the past, positive value when it comes from the future. 28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction". 29 | */ 30 | int32_t source; 31 | /** 32 | * Width and height of the block. 33 | */ 34 | uint8_t w, h; 35 | /** 36 | * Absolute source position. Can be outside the frame area. 37 | */ 38 | int16_t src_x, src_y; 39 | /** 40 | * Absolute destination position. Can be outside the frame area. 41 | */ 42 | int16_t dst_x, dst_y; 43 | /** 44 | * Extra flag information. 45 | * Currently unused. 46 | */ 47 | uint64_t flags; 48 | } AVMotionVector; 49 | 50 | #endif /* AVUTIL_MOTION_VECTOR_H */ 51 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/murmur3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Reimar Döffinger 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MURMUR3_H 22 | #define AVUTIL_MURMUR3_H 23 | 24 | #include 25 | 26 | struct AVMurMur3 *av_murmur3_alloc(void); 27 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); 28 | void av_murmur3_init(struct AVMurMur3 *c); 29 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); 30 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); 31 | 32 | #endif /* AVUTIL_MURMUR3_H */ 33 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/pixelutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_PIXELUTILS_H 20 | #define AVUTIL_PIXELUTILS_H 21 | 22 | #include 23 | #include 24 | #include "common.h" 25 | 26 | /** 27 | * Sum of abs(src1[x] - src2[x]) 28 | */ 29 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, 30 | const uint8_t *src2, ptrdiff_t stride2); 31 | 32 | /** 33 | * Get a potentially optimized pointer to a Sum-of-absolute-differences 34 | * function (see the av_pixelutils_sad_fn prototype). 35 | * 36 | * @param w_bits 1< 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get a seed to use in conjunction with random functions. 32 | * This function tries to provide a good seed at a best effort bases. 33 | * Its possible to call this function multiple times if more bits are needed. 34 | * It can be quite slow, which is why it should only be used as seed for a faster 35 | * PRNG. The quality of the seed depends on the platform. 36 | */ 37 | uint32_t av_get_random_seed(void); 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* AVUTIL_RANDOM_SEED_H */ 44 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of FFmpeg. 4 | * 5 | * FFmpeg is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * FFmpeg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with FFmpeg; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVUTIL_REPLAYGAIN_H 21 | #define AVUTIL_REPLAYGAIN_H 22 | 23 | #include 24 | 25 | /** 26 | * ReplayGain information (see 27 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 28 | * The size of this struct is a part of the public ABI. 29 | */ 30 | typedef struct AVReplayGain { 31 | /** 32 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 33 | * Should be set to INT32_MIN when unknown. 34 | */ 35 | int32_t track_gain; 36 | /** 37 | * Peak track amplitude, with 100000 representing full scale (but values 38 | * may overflow). 0 when unknown. 39 | */ 40 | uint32_t track_peak; 41 | /** 42 | * Same as track_gain, but for the whole album. 43 | */ 44 | int32_t album_gain; 45 | /** 46 | * Same as track_peak, but for the whole album, 47 | */ 48 | uint32_t album_peak; 49 | } AVReplayGain; 50 | 51 | #endif /* AVUTIL_REPLAYGAIN_H */ 52 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_RIPEMD_H 23 | #define AVUTIL_RIPEMD_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_ripemd RIPEMD 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_ripemd_size; 37 | 38 | struct AVRIPEMD; 39 | 40 | /** 41 | * Allocate an AVRIPEMD context. 42 | */ 43 | struct AVRIPEMD *av_ripemd_alloc(void); 44 | 45 | /** 46 | * Initialize RIPEMD hashing. 47 | * 48 | * @param context pointer to the function context (of size av_ripemd_size) 49 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_RIPEMD_H */ 76 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_SHA_H 22 | #define AVUTIL_SHA_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_sha SHA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_sha_size; 36 | 37 | struct AVSHA; 38 | 39 | /** 40 | * Allocate an AVSHA context. 41 | */ 42 | struct AVSHA *av_sha_alloc(void); 43 | 44 | /** 45 | * Initialize SHA-1 or SHA-2 hashing. 46 | * 47 | * @param context pointer to the function context (of size av_sha_size) 48 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 49 | * @return zero if initialization succeeded, -1 otherwise 50 | */ 51 | int av_sha_init(struct AVSHA* context, int bits); 52 | 53 | /** 54 | * Update hash value. 55 | * 56 | * @param context hash function context 57 | * @param data input data to update hash with 58 | * @param len input data length 59 | */ 60 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 61 | 62 | /** 63 | * Finish hashing and output digest value. 64 | * 65 | * @param context hash function context 66 | * @param digest buffer where output digest value is stored 67 | */ 68 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | #endif /* AVUTIL_SHA_H */ 75 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/sha512.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_SHA512_H 23 | #define AVUTIL_SHA512_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_sha512 SHA512 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_sha512_size; 37 | 38 | struct AVSHA512; 39 | 40 | /** 41 | * Allocate an AVSHA512 context. 42 | */ 43 | struct AVSHA512 *av_sha512_alloc(void); 44 | 45 | /** 46 | * Initialize SHA-2 512 hashing. 47 | * 48 | * @param context pointer to the function context (of size av_sha512_size) 49 | * @param bits number of bits in digest (224, 256, 384 or 512 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_sha512_init(struct AVSHA512* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_SHA512_H */ 76 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2003 Fabrice Bellard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_TIME_H 22 | #define AVUTIL_TIME_H 23 | 24 | #include 25 | 26 | /** 27 | * Get the current time in microseconds. 28 | */ 29 | int64_t av_gettime(void); 30 | 31 | /** 32 | * Get the current time in microseconds since some unspecified starting point. 33 | * On platforms that support it, the time comes from a monotonic clock 34 | * This property makes this time source ideal for measuring relative time. 35 | * The returned values may not be monotonic on platforms where a monotonic 36 | * clock is not available. 37 | */ 38 | int64_t av_gettime_relative(void); 39 | 40 | /** 41 | * Indicates with a boolean result if the av_gettime_relative() time source 42 | * is monotonic. 43 | */ 44 | int av_gettime_relative_is_monotonic(void); 45 | 46 | /** 47 | * Sleep for a period of time. Although the duration is expressed in 48 | * microseconds, the actual delay may be rounded to the precision of the 49 | * system timer. 50 | * 51 | * @param usec Number of microseconds to sleep. 52 | * @return zero on success or (negative) error code. 53 | */ 54 | int av_usleep(unsigned usec); 55 | 56 | #endif /* AVUTIL_TIME_H */ 57 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_XTEA_H 23 | #define AVUTIL_XTEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil XTEA algorithm 30 | * @defgroup lavu_xtea XTEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | typedef struct AVXTEA { 36 | uint32_t key[16]; 37 | } AVXTEA; 38 | 39 | /** 40 | * Initialize an AVXTEA context. 41 | * 42 | * @param ctx an AVXTEA context 43 | * @param key a key of 16 bytes used for encryption/decryption 44 | */ 45 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 46 | 47 | /** 48 | * Encrypt or decrypt a buffer using a previously initialized context. 49 | * 50 | * @param ctx an AVXTEA context 51 | * @param dst destination array, can be equal to src 52 | * @param src source array, can be equal to dst 53 | * @param count number of 8 byte blocks 54 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 55 | * @param decrypt 0 for encryption, 1 for decryption 56 | */ 57 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 58 | int count, uint8_t *iv, int decrypt); 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | #endif /* AVUTIL_XTEA_H */ 65 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWR_VERSION_H 22 | #define SWR_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 1 32 | #define LIBSWRESAMPLE_VERSION_MINOR 1 33 | #define LIBSWRESAMPLE_VERSION_MICRO 100 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWR_VERSION_H */ 46 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Headers/libswscale/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef SWSCALE_VERSION_H 20 | #define SWSCALE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * swscale version macros 25 | */ 26 | 27 | #include "libavutil/version.h" 28 | 29 | #define LIBSWSCALE_VERSION_MAJOR 3 30 | #define LIBSWSCALE_VERSION_MINOR 1 31 | #define LIBSWSCALE_VERSION_MICRO 101 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_CPU_CAPS 50 | #define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 4) 51 | #endif 52 | #ifndef FF_API_ARCH_BFIN 53 | #define FF_API_ARCH_BFIN (LIBSWSCALE_VERSION_MAJOR < 4) 54 | #endif 55 | 56 | #endif /* SWSCALE_VERSION_H */ 57 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/DJIWidget/FFmpeg/FFmpeg.framework/Info.plist -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FFmpeg { 2 | umbrella header "FFmpeg.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DJIWidget/FFmpeg/FFmpeg.framework/strip-frameworks.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Copyright 2015 Realm Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | ################################################################################ 18 | 19 | # This script strips all non-valid architectures from dynamic libraries in 20 | # the application's `Frameworks` directory. 21 | # 22 | # The following environment variables are required: 23 | # 24 | # BUILT_PRODUCTS_DIR 25 | # FRAMEWORKS_FOLDER_PATH 26 | # VALID_ARCHS 27 | # EXPANDED_CODE_SIGN_IDENTITY 28 | 29 | 30 | # Signs a framework with the provided identity 31 | code_sign() { 32 | # Use the current code_sign_identitiy 33 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 34 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" 35 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 36 | } 37 | 38 | echo "Stripping frameworks" 39 | cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" 40 | 41 | for file in $(find . -type f -perm +111); do 42 | # Skip non-dynamic libraries 43 | if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then 44 | continue 45 | fi 46 | # Get architectures for current file 47 | archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)" 48 | stripped="" 49 | for arch in $archs; do 50 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 51 | # Strip non-valid architectures in-place 52 | lipo -remove "$arch" -output "$file" "$file" || exit 1 53 | stripped="$stripped $arch" 54 | fi 55 | done 56 | if [[ "$stripped" != "" ]]; then 57 | echo "Stripped $file of architectures:$stripped" 58 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 59 | code_sign "${file}" 60 | fi 61 | fi 62 | done 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | Copyright (c) 2018 DJI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcshareddata/PanoDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | F0ABCD27-E1A6-46BA-AB6D-BB9494992369 9 | IDESourceControlProjectName 10 | project 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 22259328A86C14721C98810D95E3477A0F4DCE06 14 | github.com:DJI-Mobile-SDK/iOS-PanoramaDemo.git 15 | 16 | IDESourceControlProjectPath 17 | PanoDemo.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 22259328A86C14721C98810D95E3477A0F4DCE06 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:DJI-Mobile-SDK/iOS-PanoramaDemo.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 22259328A86C14721C98810D95E3477A0F4DCE06 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 22259328A86C14721C98810D95E3477A0F4DCE06 36 | IDESourceControlWCCName 37 | iOS-PanoramaDemo 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcshareddata/PanoDemo.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "22259328A86C14721C98810D95E3477A0F4DCE06", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "F242303504B8CDD3CE213C5B3FFB052B596793AF" : 0, 8 | "22259328A86C14721C98810D95E3477A0F4DCE06" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F0ABCD27-E1A6-46BA-AB6D-BB9494992369", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "F242303504B8CDD3CE213C5B3FFB052B596793AF" : "", 13 | "22259328A86C14721C98810D95E3477A0F4DCE06" : "iOS-PanoramaDemo\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "PanoDemo", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PanoDemo.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:DJI-Mobile-SDK\/iOS-PanoramaDemo.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "22259328A86C14721C98810D95E3477A0F4DCE06" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/oliver.ou@us003.fly-access.com\/scm\/msdk\/documentation.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "F242303504B8CDD3CE213C5B3FFB052B596793AF" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/DJI_Oliver.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/DJI_Oliver.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/edeline.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/edeline.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/edeline.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/zefei.li.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/zefei.li.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/zlinoliver.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo.xcodeproj/project.xcworkspace/xcuserdata/zlinoliver.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/DJI_Oliver.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/DJI_Oliver.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PanoDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B349F8771B68804900B5FEA6 16 | 17 | primary 18 | 19 | 20 | B349F8901B68804A00B5FEA6 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/edeline.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/edeline.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PanoDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B349F8771B68804900B5FEA6 16 | 17 | primary 18 | 19 | 20 | B349F8901B68804A00B5FEA6 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/zefei.li.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/zefei.li.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PanoDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B349F8771B68804900B5FEA6 16 | 17 | primary 18 | 19 | 20 | B349F8901B68804A00B5FEA6 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/zlinoliver.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PanoDemo.xcodeproj/xcuserdata/zlinoliver.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PanoDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B349F8771B68804900B5FEA6 16 | 17 | primary 18 | 19 | 20 | B349F8901B68804A00B5FEA6 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PanoDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/29. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /PanoDemo/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/29. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application { 19 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 20 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 21 | } 22 | 23 | - (void)applicationDidEnterBackground:(UIApplication *)application { 24 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 25 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 26 | } 27 | 28 | - (void)applicationWillEnterForeground:(UIApplication *)application { 29 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 30 | } 31 | 32 | - (void)applicationDidBecomeActive:(UIApplication *)application { 33 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 34 | } 35 | 36 | - (void)applicationWillTerminate:(UIApplication *)application { 37 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /PanoDemo/CaptureViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CaptureViewController.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/29. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CaptureViewController : UIViewController 12 | 13 | @property (strong, nonatomic) IBOutlet UIView *fpvPreviewView; 14 | @property (strong, nonatomic) IBOutlet UIButton *captureBtn; 15 | @property (strong, nonatomic) IBOutlet UIButton *downloadBtn; 16 | @property (weak, nonatomic) IBOutlet UIButton *stitchBtn; 17 | 18 | - (IBAction)onCaptureButtonClicked:(id)sender; 19 | - (IBAction)onDownloadButtonClicked:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/core/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/flann/general.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GENERAL_H_ 32 | #define OPENCV_FLANN_GENERAL_H_ 33 | 34 | #include "defines.h" 35 | #include 36 | #include 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public std::runtime_error 42 | { 43 | public: 44 | FLANNException(const char* message) : std::runtime_error(message) { } 45 | 46 | FLANNException(const std::string& message) : std::runtime_error(message) { } 47 | }; 48 | 49 | } 50 | 51 | 52 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 53 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/highgui/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #include "opencv2/core/core.hpp" 45 | #import "opencv2/highgui/cap_ios.h" 46 | 47 | UIImage* MatToUIImage(const cv::Mat& image); 48 | void UIImageToMat(const UIImage* image, 49 | cv::Mat& m, bool alphaExist = false); 50 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | #define HAVE_OPENCV_CALIB3D 10 | #define HAVE_OPENCV_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_HIGHGUI 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_LEGACY 17 | #define HAVE_OPENCV_ML 18 | #define HAVE_OPENCV_NONFREE 19 | #define HAVE_OPENCV_OBJDETECT 20 | #define HAVE_OPENCV_PHOTO 21 | #define HAVE_OPENCV_STITCHING 22 | #define HAVE_OPENCV_VIDEO 23 | #define HAVE_OPENCV_VIDEOSTAB 24 | #define HAVE_OPENCV_WORLD 25 | 26 | 27 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/videostab/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 44 | #define __OPENCV_VIDEOSTAB_HPP__ 45 | 46 | #include "opencv2/videostab/stabilizer.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Headers/world/world.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_WORLD_HPP__ 44 | #define __OPENCV_WORLD_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | #ifdef __cplusplus 49 | namespace cv 50 | { 51 | 52 | CV_EXPORTS_W bool initAll(); 53 | 54 | } 55 | 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | OpenCV 7 | CFBundleIdentifier 8 | org.opencv 9 | CFBundleVersion 10 | 2.4.9 11 | CFBundleShortVersionString 12 | 2.4.9 13 | CFBundleSignature 14 | ???? 15 | CFBundlePackageType 16 | FMWK 17 | 18 | 19 | -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/A/opencv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Frameworks/opencv2.framework/Versions/A/opencv2 -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /PanoDemo/Frameworks/opencv2.framework/opencv2: -------------------------------------------------------------------------------- 1 | Versions/Current/opencv2 -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon_120*120.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon_180*180.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "20x20", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "20x20", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "idiom" : "ipad", 57 | "size" : "29x29", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "idiom" : "ipad", 62 | "size" : "29x29", 63 | "scale" : "2x" 64 | }, 65 | { 66 | "idiom" : "ipad", 67 | "size" : "40x40", 68 | "scale" : "1x" 69 | }, 70 | { 71 | "idiom" : "ipad", 72 | "size" : "40x40", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "76x76", 77 | "idiom" : "ipad", 78 | "filename" : "Icon_76*76.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "76x76", 83 | "idiom" : "ipad", 84 | "filename" : "Icon_152*152.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "idiom" : "ipad", 89 | "size" : "83.5x83.5", 90 | "scale" : "2x" 91 | } 92 | ], 93 | "info" : { 94 | "version" : 1, 95 | "author" : "xcode" 96 | } 97 | } -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_120*120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_120*120.png -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_152*152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_152*152.png -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_180*180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_180*180.png -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_76*76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Images.xcassets/AppIcon.appiconset/Icon_76*76.png -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/btn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "btn.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PanoDemo/Images.xcassets/btn.imageset/btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DJI-Mobile-SDK-Tutorials/iOS-PanoramaDemo/8bb2bc1d7ef40318944c474791f889a7d7192e0e/PanoDemo/Images.xcassets/btn.imageset/btn.png -------------------------------------------------------------------------------- /PanoDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | DJISDKAppKey 24 | 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | NSBluetoothAlwaysUsageDescription 33 | Bluetooth use is required 34 | NSLocationWhenInUseUsageDescription 35 | 36 | NSPhotoLibraryAddUsageDescription 37 | 38 | NSPhotoLibraryUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIMainStoryboardFile 43 | Main 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedExternalAccessoryProtocols 49 | 50 | com.dji.video 51 | com.dji.protocol 52 | com.dji.common 53 | 54 | UISupportedInterfaceOrientations 55 | 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | UISupportedInterfaceOrientations~ipad 60 | 61 | UIInterfaceOrientationPortrait 62 | UIInterfaceOrientationPortraitUpsideDown 63 | UIInterfaceOrientationLandscapeLeft 64 | UIInterfaceOrientationLandscapeRight 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /PanoDemo/Models/Cropping.h: -------------------------------------------------------------------------------- 1 | // 2 | // Cropping.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/31. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Cropping : NSObject 12 | 13 | + (bool) cropWithMat: (const cv::Mat &)src andResult:(cv::Mat &)dest; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /PanoDemo/Models/OpenCVConversion.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenCVConvertion.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OpenCVConversion : NSObject 12 | 13 | + (cv::Mat)cvMatFromUIImage:(UIImage *)image;//convert UIImage to cv::Mat 14 | + (cv::Mat)cvMatGrayFromUIImage:(UIImage *)image;//convert UIImage to gray cv::Mat 15 | + (cv::Mat)cvMat3FromUIImage:(UIImage *)image; //convert UIImage to cv::Mat without alpha channel 16 | +(UIImage *)UIImageFromCVMat:(cv::Mat)cvMat;//convert cv::Mat to UIImage 17 | 18 | @end -------------------------------------------------------------------------------- /PanoDemo/Models/Stitching.h: -------------------------------------------------------------------------------- 1 | // 2 | // Stitching.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Stitching : NSObject 12 | 13 | + (bool) stitchImageWithArray:(NSMutableArray*)imageArray andResult:(cv::Mat &) result; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /PanoDemo/Models/Stitching.mm: -------------------------------------------------------------------------------- 1 | // 2 | // Stitching.m 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import "Stitching.h" 10 | #import "StitchingWrapper.h" 11 | #import "OpenCVConversion.h" 12 | 13 | #define HIGHT_COMPRESS_RATIO 0.2 14 | #define LOW_COMPRESS_RATIO 1.0 15 | 16 | @implementation Stitching 17 | 18 | + (bool) stitchImageWithArray:(NSMutableArray*)imageArray andResult:(cv::Mat &) result { 19 | if (imageArray == nil || imageArray.count == 0) { 20 | return false; 21 | } 22 | 23 | float ratio = HIGHT_COMPRESS_RATIO; 24 | UIImage *image = [imageArray firstObject]; 25 | if (image.size.height < 1000) { 26 | ratio = LOW_COMPRESS_RATIO; 27 | } 28 | 29 | NSMutableArray* compressedImageArray =[NSMutableArray new]; 30 | for(UIImage *rawImage in imageArray){ 31 | UIImage *compressedImage=[self compressedToRatio:rawImage ratio:ratio]; 32 | [compressedImageArray addObject:compressedImage]; 33 | } 34 | [imageArray removeAllObjects]; 35 | 36 | 37 | if ([compressedImageArray count]==0) { 38 | NSLog (@"imageArray is empty"); 39 | return false; 40 | } 41 | cv::vector matArray; 42 | 43 | for (id image in compressedImageArray) { 44 | if ([image isKindOfClass: [UIImage class]]) { 45 | cv::Mat matImage = [OpenCVConversion cvMat3FromUIImage:image]; 46 | matArray.push_back(matImage); 47 | } 48 | } 49 | NSLog(@"Stitching..."); 50 | if(!stitch(matArray, result)){ 51 | return false; 52 | } 53 | 54 | return true; 55 | } 56 | 57 | 58 | //compress the photo width and height to COMPRESS_RATIO 59 | + (UIImage *)compressedToRatio:(UIImage *)img ratio:(float)ratio { 60 | CGSize compressedSize; 61 | compressedSize.width=img.size.width*ratio; 62 | compressedSize.height=img.size.height*ratio; 63 | UIGraphicsBeginImageContext(compressedSize); 64 | [img drawInRect:CGRectMake(0, 0, compressedSize.width, compressedSize.height)]; 65 | UIImage* compressedImage = UIGraphicsGetImageFromCurrentImageContext(); 66 | UIGraphicsEndImageContext(); 67 | return compressedImage; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /PanoDemo/Models/StitchingWrapper.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Stitching.cpp 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | 10 | #include "stitchingWrapper.h" 11 | #include "opencv2/highgui/highgui.hpp" 12 | #include "opencv2/stitching/stitcher.hpp" 13 | 14 | using namespace cv; 15 | 16 | bool stitch (const cv::vector & images, cv::Mat &result) { 17 | Stitcher stitcher = Stitcher::createDefault(false);//don't need gpu 18 | Stitcher::Status status = stitcher.stitch(images, result); 19 | 20 | if (status != Stitcher::OK) { 21 | return false; 22 | } 23 | return true; 24 | } -------------------------------------------------------------------------------- /PanoDemo/Models/StitchingWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // StitchingWrapper.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #ifndef Stitching_Header_h 10 | #define Stitching_Header_h 11 | 12 | bool stitch (const cv::vector & images, cv::Mat &result); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /PanoDemo/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #ifndef PanoDemo_PrefixHeader_pch 10 | #define PanoDemo_PrefixHeader_pch 11 | 12 | #ifdef __cplusplus 13 | #import 14 | #endif 15 | 16 | #ifdef __OBJC__ 17 | #import 18 | #import 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /PanoDemo/StitchingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // StitchingViewController.h 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StitchingViewController : UIViewController 12 | 13 | @property (strong,nonatomic) NSMutableArray* imageArray; 14 | @property (strong, nonatomic) IBOutlet UIActivityIndicatorView* activityIndicator; 15 | @property (strong, nonatomic) IBOutlet UIImageView* imageView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /PanoDemo/StitchingViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // StitchingViewController.mm 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/30. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import "StitchingViewController.h" 10 | #import "Stitching.h" 11 | #import "OpenCVConversion.h" 12 | #import "Cropping.h" 13 | 14 | @implementation StitchingViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | 19 | __weak StitchingViewController *weakSelf = self; 20 | __weak NSMutableArray *weakImageArray = self.imageArray; 21 | 22 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 23 | cv::Mat stitchMat; 24 | if(![Stitching stitchImageWithArray:weakImageArray andResult:stitchMat]) { 25 | [weakSelf showAlertWithTitle:@"Stitching" andMessage:@"Stitching failed"]; 26 | return; 27 | } 28 | 29 | cv::Mat cropedMat; 30 | if(![Cropping cropWithMat:stitchMat andResult:cropedMat]){ 31 | [weakSelf showAlertWithTitle:@"Cropping" andMessage:@"cropping failed"]; 32 | return; 33 | } 34 | 35 | UIImage *stitchImage=[OpenCVConversion UIImageFromCVMat:cropedMat]; 36 | UIImageWriteToSavedPhotosAlbum(stitchImage, nil, nil, nil); 37 | 38 | dispatch_async(dispatch_get_main_queue(), ^{ 39 | 40 | [weakSelf showAlertWithTitle:@"Save Photo Success" andMessage:@"Panoroma photo is saved to Album, please check it!"]; 41 | _imageView.image=stitchImage; 42 | }); 43 | }); 44 | 45 | } 46 | 47 | //show the alert view in main thread 48 | -(void) showAlertWithTitle:(NSString *)title andMessage:(NSString *)message { 49 | dispatch_async(dispatch_get_main_queue(), ^{ 50 | UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 51 | [alertView show]; 52 | [_activityIndicator stopAnimating]; 53 | }); 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /PanoDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PanoDemo 4 | // 5 | // Created by DJI on 15/7/29. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PanoDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | DJI.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PanoDemoTests/PanoDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PanoDemoTests.m 3 | // PanoDemoTests 4 | // 5 | // Created by DJI on 15/7/29. 6 | // Copyright (c) 2015年 DJI. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PanoDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation PanoDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'PanoDemo' do 4 | pod 'DJI-SDK-iOS', '~> 4.16.1' 5 | end 6 | --------------------------------------------------------------------------------