--[[----------------------------------------------------------------------------

NmbAcrMockWFVideoFoundationContext.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2022 Adobe
All Rights Reserved.

NOTICE: All information contained herein is, and remains
the property of Adobe and its suppliers, if any. The intellectual
and technical concepts contained herein are proprietary to Adobe
and its suppliers and are protected by all applicable intellectual
property laws, including trade secret and copyright laws.
Dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from Adobe.

------------------------------------------------------------------------------]]

	-- RxLua
local Rx = require 'Rx'

	-- wf.core
local KSData = require 'KSData'
local KSPathUtils = require 'KSPathUtils'

	-- WF.core.utils
local WFFileUtils = require 'WFFileUtils'

	-- WF.core.rxlua
local WFRxScheduler = require 'WFRxScheduler'

--============================================================================--

local WFVideoFoundationContext = {

	_filePath = false,
		-- (string) path to the Video we're reading

}

--------------------------------------------------------------------------------

function WFVideoFoundationContext:__init( filePath )

	self._filePath = filePath

end

--------------------------------------------------------------------------------

function WFVideoFoundationContext:readMetadata()

end
--------------------------------------------------------------------------------

function WFVideoFoundationContext:render( settings, userOrientation, longSide, quality )

	local testData = string.rep('x', 4096 )
	return Rx.Observable.just( KSData.make( testData ) )
		:delay( .3, WFRxScheduler.sharedScheduler() )

end

--------------------------------------------------------------------------------

function WFVideoFoundationContext:exportFile( outputPath, outputParams, formatParams )
	-- Copy test file to temp file location to simulate exporting a file.
	WFFileUtils.copy( self._filePath, outputPath )
	local testData = string.rep('y', 4096 )
	
	return Rx.Observable.just( KSData.make( testData ) )
		:delay( .3, WFRxScheduler.sharedScheduler() )

end

--------------------------------------------------------------------------------

function WFVideoFoundationContext:getOriginalDigest()

	return Rx.Observable.just( "00112233445566778899AABBCCDDEEFF" )

end


--------------------------------------------------------------------------------

function WFVideoFoundationContext:close()

end

--------------------------------------------------------------------------------

return Rx.Class 'WFVideoFoundationContext'( WFVideoFoundationContext )
