alsa pmo variable mapping

Ed Sweetman <[email protected]>
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
this basically gives an overview of the variable dispersal across the 
alsa pmo.  It also lists methods called that we send a pointer to.  It 
does not however, give a list of methods called from any given function. 
I didn't do that because i'm not quite sure if it'll matter. Any other 
part of the pipeline has the ability to grab the pointers at the 
pipeline level without calling a function and even if it doesn't do 
things bad like that, it still will only cause a lock at the pipeline 
level to be acquired, the alsa pmo doesn't access this lock so it's use 
of pipeline variables continue anyway.  Thus it's extremely hard to say 
if locking by code-path of public methods in the alsapmo class can fully 
protect the class in thread situations.  We need to make use of only the 
pipeline lock in classes built on top of the pipeline.
alsapmo_map.text (text/plain, 3.6 KB)
alsapmo.h 

    public data outside alsapmo
	OBUFFERSIZE
	enum pmoError's

    private data to alsapmo
	struct m_group
	m_properlyInitialized
	static int audio_fd
	m_pBufferThread (pointer)
	m_iOutputBufferSize
	m_iBytesPerSample
	m_iBaseTime
	m_iDataSize
	rd_index
	alsa_bits_per_sample 
	alsa_frame_size
	alsa_bps
	struct pfds (pointer)
	nfds
	m_iCard
	m_iDevice
	m_iChannel
	m_handle (pointer)
	m_context (pointer)
	m_channels
	m_samples
	m_samplesPerFrame
	totalWrittenToALSABuffer

    Protected/private of PhysicalMediaOutput Inherited
	m_pPmi  (pointer)
	m_pLmc  (pointer)
	m_iPreBuffer 
	m_iBufferUpdate
	m_pPmiBuffer (pointer)
	
    Protected/private of PipelineUnit Inherited of PMO
	m_pSleepSem (pointer)
	m_pPauseSem (pointer)
	m_pMutex (pointer)
	m_pTarget (pointer)
	m_pOutputBuffer (pointer)
	m_pInputBuffer  (pointer)
	m_pPropManager  (pointer)
	m_bPause
	m_bExit
	m_pContext (pointer)
	m_bSleeping
			

functions in alsapmo that use private data to class.
    destructor  (pfds, m_pSleepSem, m_ppauseSem, m_pBufferThread,
		m_handle, m_bExit)
		// m_handle sent to snd_pcm_close (pointer)
		
    SetVolume   (m_iChannel, m_group)
    
    GetVolume   (m_group)
    
    Init	(m_properlyInitialized, m_iDataSize, m_context,
		m_handle, m_bExit, m_samplesPerFrame, m_channels,
		m_samples, m_iBytesPerSample, m_iDataSize, 
		alsa_frame_size, nfds, pfds)
		// m_handle sent to numerous alsa methods (pointer)
		// pfds sent to snd_pcm_poll_descriptors (pointer)
		
    Reset	(m_handle, pfds, m_properlyInitialized, m_bExit)
		// m_handle sent to alsa methods (pointer)

    Pause	(m_iBaseTime)
    
    WaitForDrain	(m_handle, m_bExit, m_bPause)
			// m_handle sent to alsa methods (pointer)
			
    HandleTimeInfoEvent (m_iBaseTime, totalWrittenToALSABuffer,
			m_samplesPerFrame, m_samples, 
			m_iBytesPerSample, m_pTarget)
		
    get_space	(m_handle, m_iDataSize)
		// m_handle is sent to alsa methods (pointer)
		
    
    WorkerThread	(totalWrittenToALSABuffer, m_pPauseSem,
			m_bExit, m_bPause, m_properlyInitialized,
			m_pInputBuffer, m_pLmc, alsa_frame_size, 
			m_pLmc, m_pTarget, pfds, nfds, m_handle,
			m_context)
			// m_handle sent to alsa methods (pointer)



Functions in PhysicalMediaOutput that use private data to class
    destructor	(m_bExit, m_pLmc, m_pPmi, m_pPauseSem, m_pSleepSem)			

    SetTo	(m_pMutex, m_pPmi, m_pLmc, m_pPmiBuffer,
		m_pInputBuffer)
		// m_pPmiBuffer sent to m_pPmi->Prepare (pointer)
		// m_pPmiBuffer and m_pInputBuffer sent to     
		// m_pLmc->Prepare (pointer)
		
    SetLMC	(m_pLmc, m_pMutex)
    
    SetPMI	(m_pPmi, m_pMutex)
    
    Pause	(m_pPmi)
    
    Resume	(m_pPmi, m_pLmc)
    
    PreBuffer 	(m_pLmc, m_iPrebBuffer)
    
    WasteTime	(m_bExit, m_bPause)
    
    ChangePosition	(m_pPmi, m_pMutex, m_pLmc, m_bPause)
    
    UpdateBufferStatus	(m_iBufferUpdate, m_pTarget, m_pPmiBuffer,
			m_pInputBuffer)
			// m_pPmiBuffer and m_pInputBuffer sent
			// to m_pTarget->AcceptEvent (pointer)
			
    CheckForBufferUp	(m_pPmi, m_pPmiBuffer, m_pInputBuffer,
			m_bExit)
			


Functions in PipelineUnit that use private data to class
    destructor	(m_pMutex, m_bExit, m_bPause, m_pPauseSem, 
		m_pSleepSem, m_pOutputBuffer)
    
    SetInputBuffer	(m_pMutex, m_pInputBuffer)
    
    SetPropManager	(m_pMutex, m_pPropManager)
    
    ReportError		(m_pTarget)
    
    ReportStatus	(m_pTarget)
    
    Pause	(m_pMutex, m_bPause)
    
    Resume	(m_pMutex, m_bPause, m_pPauseSem)
    
    Clear	(m_pMutex, m_pOutputBuffer)
    
    Wake	(m_pMutex, m_pSleepSem)
    
    Sleep	(m_pSleepSem)
    
    DebugPrint	(m_bSleeping, m_bPause, m_pOutputBuffer)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.