Avionics
Dropship Simulator
Devices::Webcam Class Reference

#include <Webcam.h>

Inheritance diagram for Devices::Webcam:
[legend]
Collaboration diagram for Devices::Webcam:
[legend]

Public Member Functions

 Webcam ()
 
void Initialize (Logger *prmLogger, WebcamConfig *prmConfig, Bus *prmBus)
 
void FrameMove ()
 
void StartRecord ()
 
void StopRecord ()
 
void Destroy ()
 
virtual ~Webcam ()
 

Private Member Functions

STDMETHODIMP QueryInterface (REFIID iid, void **ppv)
 IUnknown methods below can be moved where? More...
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
STDMETHODIMP OnReadSample (HRESULT hrStatus, DWORD dwStreamIndex, DWORD dwStreamFlags, LONGLONG llTimestamp, IMFSample *pSample)
 
STDMETHODIMP OnEvent (DWORD, IMFMediaEvent *)
 
STDMETHODIMP OnFlush (DWORD)
 
HRESULT CreateAggregatedSource (IMFMediaSource *pSource1, IMFMediaSource *pSource2, IMFMediaSource **ppAggSource) const
 
HRESULT OpenMediaSource (IMFMediaSource *pSource)
 
HRESULT ConfigureCapture ()
 
HRESULT CreateTargetVideoMediaType (IMFMediaType *pNativeMediaType, IMFMediaType **ppTargetMediaType) const
 
HRESULT CreateTargetAudioMediaType (IMFMediaType *pNativeMediaType, IMFMediaType **ppTargetMediaType) const
 
HRESULT NegotiateStreamFormat (DWORD dwStreamIndex, REFGUID guidMajorType, DWORD cFormats, const GUID **paFormats) const
 
HRESULT NegotiateVideoStreamFormat (DWORD dwStreamIndex) const
 
HRESULT NegotiateAudioStreamFormat (DWORD dwStreamIndex) const
 
BOOL IsCapturing ()
 

Private Attributes

Loggerlogger = nullptr
 
WebcamConfigconfig = nullptr
 
Busbus = nullptr
 
bool initialized = false
 
std::wstring pathAndFileName
 
std::string pathAndFileNameA
 
DeviceListvideoDevices = nullptr
 
DeviceListaudioDevices = nullptr
 
IMFActivate * pVideoActivate = nullptr
 
IMFActivate * pAudioActivate = nullptr
 
IMFMediaSource * pVideoSource = nullptr
 
IMFMediaSource * pAudioSource = nullptr
 
IMFMediaSource * pSource = nullptr
 
long m_nRefCount = 0
 
CRITICAL_SECTION m_critsec
 
IMFSourceReader * m_pReader = nullptr
 
IMFSinkWriter * m_pWriter = nullptr
 
BOOL m_bVideoFirstSample = false
 
BOOL m_bAudioFirstSample = false
 
LONGLONG m_llVideoBaseTime = 0
 
LONGLONG m_llAudioBaseTime = 0
 
DWORD sink_video_stream = 0
 
DWORD sink_audio_stream = 1
 
int recordingNumber = 0
 

Detailed Description

Definition at line 57 of file Webcam.h.

Constructor & Destructor Documentation

◆ Webcam()

Devices::Webcam::Webcam ( )

Definition at line 7 of file Webcam.cpp.

◆ ~Webcam()

Devices::Webcam::~Webcam ( )
virtual

Definition at line 27 of file Webcam.cpp.

Member Function Documentation

◆ ConfigureCapture()

HRESULT Devices::Webcam::ConfigureCapture ( )
private

Definition at line 202 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAggregatedSource()

HRESULT Devices::Webcam::CreateAggregatedSource ( IMFMediaSource *  pSource1,
IMFMediaSource *  pSource2,
IMFMediaSource **  ppAggSource 
) const
private

Definition at line 140 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTargetAudioMediaType()

HRESULT Devices::Webcam::CreateTargetAudioMediaType ( IMFMediaType *  pNativeMediaType,
IMFMediaType **  ppTargetMediaType 
) const
private
See also
https://support.google.com/youtube/answer/1722171?hl=en&rd=1

Definition at line 417 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTargetVideoMediaType()

HRESULT Devices::Webcam::CreateTargetVideoMediaType ( IMFMediaType *  pNativeMediaType,
IMFMediaType **  ppTargetMediaType 
) const
private
See also
https://support.google.com/youtube/answer/1722171?hl=en&rd=1

Definition at line 291 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Destroy()

void Devices::Webcam::Destroy ( )

Definition at line 864 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FrameMove()

void Devices::Webcam::FrameMove ( )

Definition at line 1012 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void Devices::Webcam::Initialize ( Logger prmLogger,
WebcamConfig prmConfig,
Bus prmBus 
)

Definition at line 670 of file Webcam.cpp.

Here is the caller graph for this function:

◆ IsCapturing()

BOOL Devices::Webcam::IsCapturing ( )
private

Definition at line 659 of file Webcam.cpp.

Here is the caller graph for this function:

◆ NegotiateAudioStreamFormat()

HRESULT Devices::Webcam::NegotiateAudioStreamFormat ( DWORD  dwStreamIndex) const
private

Definition at line 648 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NegotiateStreamFormat()

HRESULT Devices::Webcam::NegotiateStreamFormat ( DWORD  dwStreamIndex,
REFGUID  guidMajorType,
DWORD  cFormats,
const GUID **  paFormats 
) const
private

Definition at line 519 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NegotiateVideoStreamFormat()

HRESULT Devices::Webcam::NegotiateVideoStreamFormat ( DWORD  dwStreamIndex) const
private

must have following types for H264

See also

Definition at line 624 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnEvent()

STDMETHODIMP Devices::Webcam::OnEvent ( DWORD  ,
IMFMediaEvent *   
)
inlineprivate

Definition at line 107 of file Webcam.h.

◆ OnFlush()

STDMETHODIMP Devices::Webcam::OnFlush ( DWORD  )
inlineprivate

Definition at line 112 of file Webcam.h.

◆ OnReadSample()

HRESULT Devices::Webcam::OnReadSample ( HRESULT  hrStatus,
DWORD  dwStreamIndex,
DWORD  dwStreamFlags,
LONGLONG  llTimestamp,
IMFSample *  pSample 
)
private

Definition at line 53 of file Webcam.cpp.

Here is the call graph for this function:

◆ OpenMediaSource()

HRESULT Devices::Webcam::OpenMediaSource ( IMFMediaSource *  pSource)
private

Definition at line 175 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueryInterface()

HRESULT Devices::Webcam::QueryInterface ( REFIID  iid,
void **  ppv 
)
private

IUnknown methods below can be moved where?

Definition at line 47 of file Webcam.cpp.

◆ StartRecord()

void Devices::Webcam::StartRecord ( )

I am guessing that we don't have to activate these again?

gets the reader

Definition at line 688 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STDMETHODIMP_() [1/2]

Devices::Webcam::STDMETHODIMP_ ( ULONG  )
private

◆ STDMETHODIMP_() [2/2]

Devices::Webcam::STDMETHODIMP_ ( ULONG  )
private

◆ StopRecord()

void Devices::Webcam::StopRecord ( )

Definition at line 819 of file Webcam.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ audioDevices

DeviceList* Devices::Webcam::audioDevices = nullptr
private

Definition at line 69 of file Webcam.h.

◆ bus

Bus* Devices::Webcam::bus = nullptr
private

Definition at line 62 of file Webcam.h.

◆ config

WebcamConfig* Devices::Webcam::config = nullptr
private

Definition at line 61 of file Webcam.h.

◆ initialized

bool Devices::Webcam::initialized = false
private

Definition at line 64 of file Webcam.h.

◆ logger

Logger* Devices::Webcam::logger = nullptr
private

Definition at line 60 of file Webcam.h.

◆ m_bAudioFirstSample

BOOL Devices::Webcam::m_bAudioFirstSample = false
private

Definition at line 85 of file Webcam.h.

◆ m_bVideoFirstSample

BOOL Devices::Webcam::m_bVideoFirstSample = false
private

Definition at line 84 of file Webcam.h.

◆ m_critsec

CRITICAL_SECTION Devices::Webcam::m_critsec
private

Definition at line 79 of file Webcam.h.

◆ m_llAudioBaseTime

LONGLONG Devices::Webcam::m_llAudioBaseTime = 0
private

Definition at line 87 of file Webcam.h.

◆ m_llVideoBaseTime

LONGLONG Devices::Webcam::m_llVideoBaseTime = 0
private

Definition at line 86 of file Webcam.h.

◆ m_nRefCount

long Devices::Webcam::m_nRefCount = 0
private

Definition at line 78 of file Webcam.h.

◆ m_pReader

IMFSourceReader* Devices::Webcam::m_pReader = nullptr
private

Definition at line 81 of file Webcam.h.

◆ m_pWriter

IMFSinkWriter* Devices::Webcam::m_pWriter = nullptr
private

Definition at line 82 of file Webcam.h.

◆ pathAndFileName

std::wstring Devices::Webcam::pathAndFileName
private

Definition at line 65 of file Webcam.h.

◆ pathAndFileNameA

std::string Devices::Webcam::pathAndFileNameA
private

Definition at line 66 of file Webcam.h.

◆ pAudioActivate

IMFActivate* Devices::Webcam::pAudioActivate = nullptr
private

Definition at line 72 of file Webcam.h.

◆ pAudioSource

IMFMediaSource* Devices::Webcam::pAudioSource = nullptr
private

Definition at line 75 of file Webcam.h.

◆ pSource

IMFMediaSource* Devices::Webcam::pSource = nullptr
private

Definition at line 76 of file Webcam.h.

◆ pVideoActivate

IMFActivate* Devices::Webcam::pVideoActivate = nullptr
private

Definition at line 71 of file Webcam.h.

◆ pVideoSource

IMFMediaSource* Devices::Webcam::pVideoSource = nullptr
private

Definition at line 74 of file Webcam.h.

◆ recordingNumber

int Devices::Webcam::recordingNumber = 0
private

Definition at line 133 of file Webcam.h.

◆ sink_audio_stream

DWORD Devices::Webcam::sink_audio_stream = 1
private

Definition at line 89 of file Webcam.h.

◆ sink_video_stream

DWORD Devices::Webcam::sink_video_stream = 0
private

Definition at line 88 of file Webcam.h.

◆ videoDevices

DeviceList* Devices::Webcam::videoDevices = nullptr
private

Definition at line 68 of file Webcam.h.


The documentation for this class was generated from the following files: