From fcbfd611234495bdc1157f4f393c1c2e5f91852e Mon Sep 17 00:00:00 2001 From: rjongbloed Date: Sun, 9 Apr 2006 12:01:43 +0000 Subject: [PATCH] Added missing Clone() functions so media options propagate correctly. --- include/opal/mediafmt.h | 9 +++++++++ src/opal/mediafmt.cxx | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/opal/mediafmt.h b/include/opal/mediafmt.h index 0692c49e..70602e6c 100644 --- a/include/opal/mediafmt.h +++ b/include/opal/mediafmt.h @@ -25,6 +25,9 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.38 2006/04/09 12:01:43 rjongbloed + * Added missing Clone() functions so media options propagate correctly. + * * Revision 2.37 2005/12/27 20:46:09 dsandras * Added clockRate to the media format. Added "AlwaysMerge" method for merging * media format options. @@ -660,6 +663,10 @@ class OpalMediaFormat : public PCaselessString const PString & wildcard ///< Wildcard name to search for ); + /**Create a copy of the media format. + */ + virtual PObject * Clone() const; + /**Merge with another media format. This will alter and validate the options for this media format according to the merge rule for each option. The parameter is typically a "capability" while the @@ -940,6 +947,8 @@ class OpalVideoFormat : public OpalMediaFormat unsigned bitRate ///< Maximum bits per second ); + virtual PObject * Clone() const; + virtual bool Merge(const OpalMediaFormat & mediaFormat); static const char * const FrameWidthOption; diff --git a/src/opal/mediafmt.cxx b/src/opal/mediafmt.cxx index 41fedc7e..91324421 100644 --- a/src/opal/mediafmt.cxx +++ b/src/opal/mediafmt.cxx @@ -24,6 +24,9 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.44 2006/04/09 12:01:44 rjongbloed + * Added missing Clone() functions so media options propagate correctly. + * * Revision 2.43 2006/03/20 10:37:47 csoutheren * Applied patch #1453753 - added locking on media stream manipulation * Thanks to Dinis Rosario @@ -693,6 +696,12 @@ OpalMediaFormat & OpalMediaFormat::operator=(const PString & wildcard) } +PObject * OpalMediaFormat::Clone() const +{ + return new OpalMediaFormat(*this); +} + + bool OpalMediaFormat::Merge(const OpalMediaFormat & mediaFormat) { PWaitAndSignal auto_signal(GetMediaFormatsListMutex()); @@ -979,6 +988,12 @@ OpalVideoFormat::OpalVideoFormat(const char * fullName, } +PObject * OpalVideoFormat::Clone() const +{ + return new OpalVideoFormat(*this); +} + + bool OpalVideoFormat::Merge(const OpalMediaFormat & mediaFormat) { if (!OpalMediaFormat::Merge(mediaFormat)) -- 2.11.4.GIT