sbVideoBox.cpp
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2009 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #include "sbVideoBox.h"
26 
31 #ifdef PR_LOGGING
32 static PRLogModuleInfo * VideoBox() {
33  static PRLogModuleInfo* gVideoBox = PR_NewLogModule("sbVideoBox");
34  return gVideoBox;
35 }
36 
37 #define TRACE(args) PR_LOG(VideoBox() , PR_LOG_DEBUG, args)
38 #define LOG(args) PR_LOG(VideoBox() , PR_LOG_WARN, args)
39 #else
40 #define TRACE(args) /* nothing */
41 #define LOG(args) /* nothing */
42 #endif
43 
46 
48 : mPARNumerator(0)
49 , mPARDenominator(0)
50 {
51  TRACE(("sbVideoBox[0x%x] - Created", this));
52 }
53 
55 {
56  TRACE(("sbVideoBox[0x%x] - Destroyed", this));
57 }
58 
59 nsresult
61  PRUint32 aHeight,
62  PRUint32 aParNumerator /*= 1*/,
63  PRUint32 aParDenominator /*= 1*/)
64 {
65  TRACE(("sbVideoBox[0x%x] - Init", this));
66 
67  mWidth = aWidth;
68  mHeight = aHeight;
69  mPARNumerator = aParNumerator;
70  mPARDenominator = aParDenominator;
71 
72  return NS_OK;
73 }
74 
75 NS_IMETHODIMP
76 sbVideoBox::GetParNumerator(PRUint32 *aParNumerator)
77 {
78  TRACE(("sbVideoBox[0x%x] - GetParNumerator", this));
79  NS_ENSURE_ARG_POINTER(aParNumerator);
80 
81  *aParNumerator = mPARNumerator;
82 
83  return NS_OK;
84 }
85 
86 NS_IMETHODIMP
87 sbVideoBox::GetParDenominator(PRUint32 *aParDenominator)
88 {
89  TRACE(("sbVideoBox[0x%x] - GetParDenominator", this));
90  NS_ENSURE_ARG_POINTER(aParDenominator);
91 
92  *aParDenominator = mPARDenominator;
93 
94  return NS_OK;
95 }
96 
97 NS_IMETHODIMP
98 sbVideoBox::GetWidth(PRUint32 *aWidth)
99 {
100  TRACE(("sbVideoBox[0x%x] - GetWidth", this));
101  NS_ENSURE_ARG_POINTER(aWidth);
102 
103  *aWidth = mWidth;
104 
105  return NS_OK;
106 }
107 
108 NS_IMETHODIMP
109 sbVideoBox::GetHeight(PRUint32 *aHeight)
110 {
111  TRACE(("sbVideoBox[0x%x] - GetHeight", this));
112  NS_ENSURE_ARG_POINTER(aHeight);
113 
114  *aHeight = mHeight;
115 
116  return NS_OK;
117 }
virtual ~sbVideoBox()
Definition: sbVideoBox.cpp:54
PRUint32 mPARDenominator
Definition: sbVideoBox.h:48
return NS_OK
restoreDimensions aWidth
PRUint32 mPARNumerator
Definition: sbVideoBox.h:47
PRUint32 mHeight
Definition: sbVideoBox.h:51
restoreDimensions aHeight
nsresult Init(PRUint32 aWidth, PRUint32 aHeight, PRUint32 aParNumerator=1, PRUint32 aParDenominator=1)
Definition: sbVideoBox.cpp:60
NS_IMPL_THREADSAFE_ISUPPORTS1(sbVideoBox, sbIVideoBox) sbVideoBox
Definition: sbVideoBox.cpp:44
PRUint32 mWidth
Definition: sbVideoBox.h:50
#define TRACE(args)
Definition: sbVideoBox.cpp:40