D. Implementation
The implementation of our web-based video streaming
application is illustrated in Fig. 6. The core of the application
is composed of two ActionScript classes. The main class is
for the main application and the ALVAR class is for
exchanging data with ALVAR Flash Library. The main class
is responsible for loading the configuration file, initializing a
webcam and the application in general and processing each
frame. The ALVAR class is used only for passing data to
and receiving it from ALVAR Flash Library.
The configuration file used by the main class is in XML
format. This was chosen because it is a very common format
and also because Flash has native support for reading and
parsing XML. The structure of the configuration file is
intuitive and easily extendable. The basic information
containing the two timer delays mentioned above is located
under a dedicated XML element, while the marker
information is located under another element. The element
for the basic information contains an individual element for
each information item. Similarly, the element for each
marker contains elements for each marker’s information
item. All marker elements are listed under the marker
information element. Additional elements, which can be read
by the application, can be easily added to the structure,
enabling the application to be extendable with minimal
effort.
Pose and position information is received from ALVAR
Flash Library as a transformation matrix, which is a 4 by 4
matrix. This format is also used by the 3D plane for
representing its pose and position. Thus, the matrix received
from ALVAR Flash Library can be directly set as the 3D
plane’s new transformation matrix without any additional
processing.
The transformation matrix is also used when the 3D
plane is presented so that it faces the camera at all times
(billboarding). In that case, the transformation matrix must
be modified before it is applied to the 3D plane.
Streaming a video in Flash is a straightforward process.
Flash has good support for initiating and controlling a
streaming session, including a set of events for informing of
any changes in the stream’s status. In addition, the received
stream can be set as the 3D plane texture directly without
any pre-processing.
The ALVAR class acts as the interface to ALVAR Flash
Library, as mentioned above. It is responsible for providing
webcam frame data to ALVAR Flash Library, which it does
by utilizing shared memory space, as discussed in Section III
B. The ALVAR class allocates the required memory space in
D. Implementation
The implementation of our web-based video streaming
application is illustrated in Fig. 6. The core of the application
is composed of two ActionScript classes. The main class is
for the main application and the ALVAR class is for
exchanging data with ALVAR Flash Library. The main class
is responsible for loading the configuration file, initializing a
webcam and the application in general and processing each
frame. The ALVAR class is used only for passing data to
and receiving it from ALVAR Flash Library.
The configuration file used by the main class is in XML
format. This was chosen because it is a very common format
and also because Flash has native support for reading and
parsing XML. The structure of the configuration file is
intuitive and easily extendable. The basic information
containing the two timer delays mentioned above is located
under a dedicated XML element, while the marker
information is located under another element. The element
for the basic information contains an individual element for
each information item. Similarly, the element for each
marker contains elements for each marker’s information
item. All marker elements are listed under the marker
information element. Additional elements, which can be read
by the application, can be easily added to the structure,
enabling the application to be extendable with minimal
effort.
Pose and position information is received from ALVAR
Flash Library as a transformation matrix, which is a 4 by 4
matrix. This format is also used by the 3D plane for
representing its pose and position. Thus, the matrix received
from ALVAR Flash Library can be directly set as the 3D
plane’s new transformation matrix without any additional
processing.
The transformation matrix is also used when the 3D
plane is presented so that it faces the camera at all times
(billboarding). In that case, the transformation matrix must
be modified before it is applied to the 3D plane.
Streaming a video in Flash is a straightforward process.
Flash has good support for initiating and controlling a
streaming session, including a set of events for informing of
any changes in the stream’s status. In addition, the received
stream can be set as the 3D plane texture directly without
any pre-processing.
The ALVAR class acts as the interface to ALVAR Flash
Library, as mentioned above. It is responsible for providing
webcam frame data to ALVAR Flash Library, which it does
by utilizing shared memory space, as discussed in Section III
B. The ALVAR class allocates the required memory space in
การแปล กรุณารอสักครู่..