h281handler.h
Go to the documentation of this file.
/*
* h281handler.h
*
* H.281 protocol handler implementation for the OpenH323 Project.
*
* Copyright (c) 2006 Network for Educational Technology, ETH Zurich.
* Written by Hannes Friederich.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* Contributor(s): ______________________________________.
*
* $Revision: 24178 $
* $Author: rjongbloed $
* $Date: 2010-04-05 19:10:56 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef OPAL_H224_H281HANDLER_H
#define OPAL_H224_H281HANDLER_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#ifndef _PTLIB_H
#include <ptlib.h>
#endif
#include <opal/buildopts.h>
#include <h224/h224handler.h>
#include <h224/h281.h>
class OpalH224Handler;
class H281VideoSource : public PObject
{
PCLASSINFO(H281VideoSource, PObject);
public:
H281VideoSource();
~H281VideoSource();
PBoolean IsEnabled() const { return isEnabled; }
void SetEnabled(PBoolean flag) { isEnabled = flag; }
BYTE GetVideoSourceNumber() const { return (firstOctet >> 4) & 0x0f; }
void SetVideoSourceNumber(BYTE number);
PBoolean CanMotionVideo() const { return (firstOctet >> 2) & 0x01; }
void SetCanMotionVideo(PBoolean flag);
PBoolean CanNormalResolutionStillImage() const { return (firstOctet >> 1) & 0x01; }
void SetCanNormalResolutionStillImage(PBoolean flag);
PBoolean CanDoubleResolutionStillImage() const { return (firstOctet & 0x01); }
void SetCanDoubleResolutionStillImage(PBoolean flag);
PBoolean CanPan() const { return (secondOctet >> 7) & 0x01; }
void SetCanPan(PBoolean flag);
PBoolean CanTilt() const { return (secondOctet >> 6) & 0x01; }
void SetCanTilt(PBoolean flag);
PBoolean CanZoom() const { return (secondOctet >> 5) & 0x01; }
void SetCanZoom(PBoolean flag);
PBoolean CanFocus() const { return (secondOctet >> 4) & 0x01; }
void SetCanFocus(PBoolean flag);
void Encode(BYTE *data) const;
PBoolean Decode(const BYTE *data);
protected:
PBoolean isEnabled;
BYTE firstOctet;
BYTE secondOctet;
};
class OpalH281Handler : public OpalH224Client
{
PCLASSINFO(OpalH281Handler, PObject);
public:
OpalH281Handler();
~OpalH281Handler();
enum VideoSource {
CurrentVideoSource = 0x00,
MainCamera = 0x01,
AuxiliaryCamera = 0x02,
DocumentCamera = 0x03,
AuxiliaryDocumentCamera = 0x04,
VideoPlaybackSource = 0x05
};
virtual BYTE GetClientID() const { return OpalH224Client::H281ClientID; }
virtual PBoolean HasExtraCapabilities() const { return true; }
virtual void OnReceivedExtraCapabilities(const BYTE *capabilities, PINDEX size);
virtual void OnReceivedMessage(const H224_Frame & message);
BYTE GetLocalNumberOfPresets() const { return localNumberOfPresets; }
void SetLocalNumberOfPresets(BYTE presets) { localNumberOfPresets = presets; }
BYTE GetRemoteNumberOfPresets() const { return remoteNumberOfPresets; }
H281VideoSource & GetLocalVideoSource(VideoSource source);
H281VideoSource & GetRemoteVideoSource(VideoSource source);
void StartAction(H281_Frame::PanDirection panDirection,
H281_Frame::TiltDirection tiltDirection,
H281_Frame::ZoomDirection zoomDireciton,
H281_Frame::FocusDirection focusDirection);
void StopAction();
void SelectVideoSource(BYTE videoSourceNumber, H281_Frame::VideoMode videoMode);
void StoreAsPreset(BYTE presetNumber);
void ActivatePreset(BYTE presetNumber);
void SendExtraCapabilities() const;
/*
* methods that subclasses can override.
* The default handler does not implement FECC on the local side.
* Thus, the default behaviour is to do nothing.
*/
virtual void OnRemoteCapabilitiesUpdated();
virtual void OnStartAction(H281_Frame::PanDirection panDirection,
H281_Frame::TiltDirection tiltDirection,
H281_Frame::ZoomDirection zoomDirection,
H281_Frame::FocusDirection focusDirection);
virtual void OnStopAction();
virtual void OnSelectVideoSource(BYTE videoSourceNumber, H281_Frame::VideoMode videoMode);
virtual void OnStoreAsPreset(BYTE presetNumber);
virtual void OnActivatePreset(BYTE presetNumber);
protected:
PDECLARE_NOTIFIER(PTimer, OpalH281Handler, ContinueAction);
PDECLARE_NOTIFIER(PTimer, OpalH281Handler, StopActionLocally);
BYTE localNumberOfPresets;
BYTE remoteNumberOfPresets;
H281VideoSource localVideoSources[6];
H281VideoSource remoteVideoSources[6];
H281_Frame transmitFrame;
PTimer transmitTimer;
H281_Frame::PanDirection requestedPanDirection;
H281_Frame::TiltDirection requestedTiltDirection;
H281_Frame::ZoomDirection requestedZoomDirection;
H281_Frame::FocusDirection requestedFocusDirection;
PTimer receiveTimer;
};
#endif // OPAL_H224_H281HANDLER_H
OpalH281Handler::transmitFrame
H281_Frame transmitFrame
Definition: h281handler.h:207
OpalH281Handler::OnStartAction
virtual void OnStartAction(H281_Frame::PanDirection panDirection, H281_Frame::TiltDirection tiltDirection, H281_Frame::ZoomDirection zoomDirection, H281_Frame::FocusDirection focusDirection)
OpalH281Handler::HasExtraCapabilities
virtual PBoolean HasExtraCapabilities() const
Definition: h281handler.h:116
OpalH281Handler::PDECLARE_NOTIFIER
PDECLARE_NOTIFIER(PTimer, OpalH281Handler, ContinueAction)
OpalH224Handler
Definition: h224handler.h:136
OpalH281Handler::GetRemoteNumberOfPresets
BYTE GetRemoteNumberOfPresets() const
Definition: h281handler.h:125
OpalH281Handler::OpalH281Handler
OpalH281Handler()
OpalH224Client
Definition: h224handler.h:47
H281VideoSource::H281VideoSource
H281VideoSource()
H281VideoSource::SetCanTilt
void SetCanTilt(PBoolean flag)
H281VideoSource::SetVideoSourceNumber
void SetVideoSourceNumber(BYTE number)
buildopts.h
OpalH281Handler::AuxiliaryCamera
Definition: h281handler.h:108
OpalH281Handler::SelectVideoSource
void SelectVideoSource(BYTE videoSourceNumber, H281_Frame::VideoMode videoMode)
OpalH281Handler::GetLocalNumberOfPresets
BYTE GetLocalNumberOfPresets() const
Definition: h281handler.h:122
OpalH281Handler::GetLocalVideoSource
H281VideoSource & GetLocalVideoSource(VideoSource source)
H281VideoSource::SetCanFocus
void SetCanFocus(PBoolean flag)
H281VideoSource::isEnabled
PBoolean isEnabled
Definition: h281handler.h:88
H281_Frame::VideoMode
VideoMode
Definition: h281.h:84
OpalH281Handler::OnReceivedMessage
virtual void OnReceivedMessage(const H224_Frame &message)
OpalH281Handler::SetLocalNumberOfPresets
void SetLocalNumberOfPresets(BYTE presets)
Definition: h281handler.h:123
H281VideoSource::SetCanPan
void SetCanPan(PBoolean flag)
H224_Frame
Definition: h224.h:91
OpalH281Handler::requestedZoomDirection
H281_Frame::ZoomDirection requestedZoomDirection
Definition: h281handler.h:212
H281VideoSource::CanPan
PBoolean CanPan() const
Definition: h281handler.h:71
H281VideoSource::secondOctet
BYTE secondOctet
Definition: h281handler.h:90
H281_Frame
Definition: h281.h:39
H281_Frame::PanDirection
PanDirection
Definition: h281.h:56
OpalH281Handler::VideoSource
VideoSource
Definition: h281handler.h:105
H281VideoSource::Decode
PBoolean Decode(const BYTE *data)
OpalH281Handler::StoreAsPreset
void StoreAsPreset(BYTE presetNumber)
OpalH281Handler
Definition: h281handler.h:96
OpalH281Handler::localNumberOfPresets
BYTE localNumberOfPresets
Definition: h281handler.h:202
H281VideoSource::IsEnabled
PBoolean IsEnabled() const
Definition: h281handler.h:56
OpalH281Handler::transmitTimer
PTimer transmitTimer
Definition: h281handler.h:208
h224handler.h
OpalH281Handler::requestedFocusDirection
H281_Frame::FocusDirection requestedFocusDirection
Definition: h281handler.h:213
H281_Frame::FocusDirection
FocusDirection
Definition: h281.h:77
OpalH281Handler::requestedPanDirection
H281_Frame::PanDirection requestedPanDirection
Definition: h281handler.h:210
H281VideoSource::SetCanMotionVideo
void SetCanMotionVideo(PBoolean flag)
OpalH281Handler::AuxiliaryDocumentCamera
Definition: h281handler.h:110
OpalH281Handler::requestedTiltDirection
H281_Frame::TiltDirection requestedTiltDirection
Definition: h281handler.h:211
H281VideoSource::CanFocus
PBoolean CanFocus() const
Definition: h281handler.h:80
OpalH281Handler::remoteNumberOfPresets
BYTE remoteNumberOfPresets
Definition: h281handler.h:203
OpalH281Handler::CurrentVideoSource
Definition: h281handler.h:106
OpalH281Handler::OnActivatePreset
virtual void OnActivatePreset(BYTE presetNumber)
H281VideoSource
Definition: h281handler.h:47
OpalH281Handler::MainCamera
Definition: h281handler.h:107
OpalH281Handler::SendExtraCapabilities
void SendExtraCapabilities() const
OpalH281Handler::localVideoSources
H281VideoSource localVideoSources[6]
Definition: h281handler.h:204
H281VideoSource::~H281VideoSource
~H281VideoSource()
OpalH281Handler::OnRemoteCapabilitiesUpdated
virtual void OnRemoteCapabilitiesUpdated()
OpalH281Handler::OnReceivedExtraCapabilities
virtual void OnReceivedExtraCapabilities(const BYTE *capabilities, PINDEX size)
H281VideoSource::SetCanZoom
void SetCanZoom(PBoolean flag)
OpalH281Handler::remoteVideoSources
H281VideoSource remoteVideoSources[6]
Definition: h281handler.h:205
H281VideoSource::SetCanDoubleResolutionStillImage
void SetCanDoubleResolutionStillImage(PBoolean flag)
OpalH281Handler::DocumentCamera
Definition: h281handler.h:109
OpalH281Handler::StartAction
void StartAction(H281_Frame::PanDirection panDirection, H281_Frame::TiltDirection tiltDirection, H281_Frame::ZoomDirection zoomDireciton, H281_Frame::FocusDirection focusDirection)
H281VideoSource::SetEnabled
void SetEnabled(PBoolean flag)
Definition: h281handler.h:57
H281VideoSource::GetVideoSourceNumber
BYTE GetVideoSourceNumber() const
Definition: h281handler.h:59
OpalH281Handler::ActivatePreset
void ActivatePreset(BYTE presetNumber)
OpalH281Handler::OnSelectVideoSource
virtual void OnSelectVideoSource(BYTE videoSourceNumber, H281_Frame::VideoMode videoMode)
OpalH281Handler::receiveTimer
PTimer receiveTimer
Definition: h281handler.h:214
H281VideoSource::SetCanNormalResolutionStillImage
void SetCanNormalResolutionStillImage(PBoolean flag)
OpalH281Handler::GetClientID
virtual BYTE GetClientID() const
Definition: h281handler.h:115
OpalH224Client::H281ClientID
Definition: h224handler.h:58
OpalH281Handler::OnStopAction
virtual void OnStopAction()
OpalH281Handler::GetRemoteVideoSource
H281VideoSource & GetRemoteVideoSource(VideoSource source)
OpalH281Handler::~OpalH281Handler
~OpalH281Handler()
OpalH281Handler::VideoPlaybackSource
Definition: h281handler.h:111
H281VideoSource::CanMotionVideo
PBoolean CanMotionVideo() const
Definition: h281handler.h:62
h281.h
H281_Frame::ZoomDirection
ZoomDirection
Definition: h281.h:70
H281VideoSource::CanTilt
PBoolean CanTilt() const
Definition: h281handler.h:74
H281VideoSource::firstOctet
BYTE firstOctet
Definition: h281handler.h:89
OpalH281Handler::StopAction
void StopAction()
H281VideoSource::CanDoubleResolutionStillImage
PBoolean CanDoubleResolutionStillImage() const
Definition: h281handler.h:68
OpalH281Handler::OnStoreAsPreset
virtual void OnStoreAsPreset(BYTE presetNumber)
H281_Frame::TiltDirection
TiltDirection
Definition: h281.h:63
H281VideoSource::CanNormalResolutionStillImage
PBoolean CanNormalResolutionStillImage() const
Definition: h281handler.h:65
H281VideoSource::CanZoom
PBoolean CanZoom() const
Definition: h281handler.h:77
H281VideoSource::Encode
void Encode(BYTE *data) const