Multimedia flow apps in Microsoft Windows CE 3.0 (below)

zhaozj2021-02-11  170

Windows Media Protocols

The following protocols are supported by WMT: MultiCasting, Local File Streaming, HTTP Streaming, and MMS Streaming.

Multicast enables the client to accept the MultiCast stream. This allows the system administrator to send a copy of the content to many users on the network, as long as the network allows multiple points. IP multicast streaming is using Microsoft Windows Media Station Metafile via ASF. When the network does not support multi-point transfer or ASF files are fluidized by the Windows Media server, the network is transmitted by Unicast. Unicast means that a stream is sent to every request.

WMT can use permanent storage to provide a local file stream for the system. The data is read from the permanent storage of a buffer and rendered. Local Field Flow supports Lower Latency and an important physical memory storage. Before playing files, all ASF files will read from permanent storage from permanent physical memory.

MMS is the streaming of Microsoft's streaming protocol. A typical MMS Session uses a TCP connection to send and accept the media control command and use TCP or UDP to control the data stream. Call the MMS protocol Use the MMS: // Call the protocol ROLLOVER mechanism. A client first tries to use UDP to accept the stream. If UDP does not work, the stream automatically communicates over TCP. Finally, if TCP does not work, the client will try to receive flow with HTTP. The MMSU is the client to receive flow through UDP. This is very suitable for audio transmission because it transmits packets regardless of the connection quality. Therefore, the user sounds delayed and paused. If time allows, the lost package will be re-requested and is reissued. MMST allows the client to receive streams through TCP. The TCP composition is a reliable stream. If the package is lost, the stream will stop and the lost package is retransmitted. When the network is crowded, the user will hear more delay and pause.

A normal HTTP server can pass the ASF data stream, but because of several reasons, it is replaced by Windows Media Server. The package in the ASF data stream must be continuously transmitted, a PER network package, which is implemented for all the benefits of the data stream. Only ASF-Compatible servers, such as Windows Media Server, avoid breaking, smart compression into a separate Internet or other network protocol by passing an ASF package. Error correction, streaming, and bit-rate optimization, ASF has been calculated by the client and server-side calculation results from the start and end of the ASF packet transfer. The HTTP server does not have this capability because it does not recognize the importance of the ASF package; it is pushed to the client as fast as possible, and the data packets equivalent to multiple data are filld. Plus, several features of Windows Media, such as the ability of Fast-Forward or Rewind ASF data streams, cannot be supported by a normal web server.

Windows Media Codecs

Windows Media Decoder

The following table lists the supported decoders that can be included inside the ASF file. Windows CE WMT only supports content created by Windows Media Tools. Windows Media Encoder uses templates to convert dynamic sources or avi, WAV, MP3 content encoding to ASF format, using decoders in the table below. The template also supports the use of other decoders, but the DirectShow for Windows CE only supports the WMT decoder. Although other decoders (such as CinePak or MPEG-1) can create ASF files by other tools to be used by DirectShow for Windows CE, this does not guarantee their stream performance, which is not recommended. Codec Name Description

MPEG-4 V3, V2 MPEG-4 Video Codec; Up To 30 FPS QCIF (176x144) - CIF (352x288) Resolution Video AT 28.8 Kbps - 300 kbps

WMAudio v2 New Windows Media audio codec based on non-uniform modulated lapped bioorthogonal transforms (NMLBT) in place of DCT for perceptual coding of both voice and high-fidelity; 8 - 48 kHz stereo at 56 - 128 kbps; near-FM quality at 28.8 KBPS AND NEAR-CD Quality AT 64 Kbps

ACELP.NET SIPRO ACELP VOICE CODEC; Speech-Quality 8 - 16 kHz Mono AT 5 - 16 Kbps

MPEG-1 Layer 3 Fraunhofer MP3 Perceptual Audio Codec; Near-CD Quality AT 128 Kbps

The Componentization of WMT for Windows CE allows you to create a fully customized streaming client, cutting your designated stream environment. WMT FOR CE can be split so that you can decide that components are included in your application. The following components can be appropriately selected.

MMS streaming

Http streaming

File streaming

Broadcast And Multi Bit Streaming

Windows Media Station Support

ASX Support

CODECS

DirectShow

DirectShow provides underlying support for multimedia streams on a local or web server. It can be clarified that DirectShow can play video and audio content compressed in various files and stream formats, including Windows Media, MPEG, Audio-Video Interleaved (AVI), and WAV.

The application controls the behavior of Filter Graph by communicating with Filter Graph Manager. You can control the Microsoft Windows Media Player control or call the COM interface directly.

DirectShow Services is used to call the Filters Pluggable Components module set, which can call Filter Graph based on the media type. Filters performs read, parse, decode, format, or render, etc.

Filters call Filter Graph by a structure, which is constrained by Filter Graph Manager (FGM). A DirectShow Filter Graph (see Figure 2) consists of a set of controlled Filters sequences, from Source to the last RENDERERS, all connections are entered or output via Filter Pins. When the media type is supported by them, Filter Pins is responsible for consultation. FGM controls multimedia data flow between Graph filters. Because DirectShow is a flexible, reconfigurable Filter Graph architecture, DirectShow can use the same software components to support many media type playback and flow. Developers can also extend DirectShow's multimedia support by writing their own filters, Figure 2. DirectShow Filter Graph (MultiMedia2.gif)

Filter Graph Manager

An application uses the Filter Graph Manager (FGM) interface to create, connect, and control Filter Graphs. The filter uses the FGM interface to issue event notifications, and enforce the filter pins to reconnect when needed. In particular, the IGRAPHBUILDER interface allows the application to call Filter Graph Manager to try to create a Complete filter graph, or create Partial Filter Graph if only part of the information is given, such as only the file name or two separate Pins interface. . Filter Mapper Viewing the Filter that can be used in the registration table correctly configure the filter graph. The IGRAPHBuilder interface creates a filter graph, adds or deletes Filters from the Filter Graph, enumerate all the filters in the Filter Graph, and enforce the connection when adding a Filter. Filter Graph is established when appropriate, the application needs to create an instance of an IGRAPHBUILDER interface and call the Renderfile method.

In addition, FGM exposes media control and media configuration interface to the application. Media Control Interface, IMEDIACONTROL, allows applications to send Run, PAUSE, and STOP command control flow. When the RUN method is called, the return starts. Media configuration interface, iMediaseEKing, let the application specify the portion of the stream of playback.

Internally, FGM will use each Filter's basefilter interface to find and list the input and output Pins of the Filter.

Filters

Filters is the DirectShow class that completes most media handling tasks. Filter tasks include:

Source Acquisition (E.G., Acquire a Media Stream)

Parsing (E.G., Perform Packet Reading, Splitting, And Formatting on the stream)

Transformation (E.G., Decode Wma and MPEG-4 Audio and Video Streams)

Rendering (E.G., Generate Audio PCM or Video RGB / YUV OUTPUT At The Right Time and Pass Data On To DirectSound and DirectDraw)

Filters uses several types of interfaces, such as Pins, Enumerators, Transports, and Clock interfaces to complete tasks. Filters achieves and exposes many interfaces. FGM creates, connected, and controls graphs using these interfaces. A Filter always implements the IBASEFILTER interface, which contains the following methods: Run, Stop, and Pause Filter State

Retrieve Filter and Vendor Information

Get and set the Reference Clock

Retrieve Filter State Information

ENUMERATE FILTER PINS

LOCATE PINS WHEN REBUILDING A FILTER GRAPH

Each Filters exposes an IBaseFilter interface that allows Filter Graph Manager to execute commands such as Run, Pause, and STOP. Filter Graph Manager is the reason for calling these methods in the correct order. Your application should not be operated directly.

In fact, different from the IBaseFilter interface, only renderer filter exposes the iMediaseEKing interface. Therefore, Filter Graph Manager is only called renderer filter by configuration information. The rendere is then configured by configuring the control information, just simply passing the Pins that retract the IMEDIASEEKING interface. The configuration of the media stream is actually the output PIN control, enabling it to find the correct location, usually a Parser Filter like Avi Splitter.

Windows CE DXPAK 1.2 supports the following DX 6.1 DirectShow Filters:

Source Filters-File Source (Asynchronous and URL)

Parsers and Splitters-MPEG-1 Stream Splitter, Avi Splitter, QuickTime Parser, Wave Parser, Midi Parser, Asf Parser, Asx Parser, ASF Splitter

Decoders-Msaudio Decoder, MPEG-1 Audio Decoder, MPEG-1 Video Decoder, MPEG-4 Video Decoder, AVI Decompressor, ACM Audio Decompressor

RENDERERS-AUDIO RENDERER (Using Waveout), DirectSound Audio Renderer, Video Rendrer (Using Either DirectDraw Or GDI)

Miscellaneous Filters-Overlay Mixer

To support the stream of Windows Media Formats, special ASF / ASX Streame Source and WMA Codec Transform Filters are provided. In addition, Fraunhofer MP3 Audio and Sipro Acerp.Net Speech Codec use Audio Compression Manager (ACM) Wrapper Audio Decompressor Transform Filter.

DirectShow Broadcasting Technology and DV Filters are not included in DXPAK, but can be used in Windows CE WebTV Microsoft TV (MSTV) KIT.

EXAMPLE

example

DirectSHOW can use it to play or transmit multimedia files. Here is a simple code snippet, demonstrate how to write a multimedia file player (note that in order to simplify the code, we do not check the return value of QueryInterface). HRESULT Playmovie (LPTSTSTSTSTSTSTSTSTSZMOVIE)

{

// We Will Use Several DirectShow Interfaces

IMEDIACONTROL * PMC = NULL;

IGRAPHBUILDER * PGB = NULL;

IMediaEventEx * Pme = null;

Long Evcode; // Something to Hold A Returned Event Code

// instantiate a filter graph as in-proc server

HR = CoCreateInstance (CLSID_FILTERGRAPH, NULL, CLSCTX_INPROC,

IID_IGRAPHBUILDER, (VOID **) & PGB);

// we'll Use this interface to build the graph

HR = PGB-> Queryinterface (IID_MEDIACONTROL, (VOID **) & PMC);

// We'll Want To Wait for Completion of The Rendering, So We need a media

EVENT INTERFACE

HR = PMC-> QueryInterface (IID_IMEDIAEVENTEX, (Void **) & PME);

// Now We're Ready To Build The Filter Graph Based on The Source File Data

Types

HR = PGB-> Renderfile (LPSZMOVIE, NULL);

// Play the Source File

HR = PMC-> Run ();

// Block Application Until Video Rendering Operations Finish

HR = PME-> WaitForcompletion (Infinite, & Evcode);

// Release Interfaces

}

Several annotations are useful. CoCreateInstance implements a Filter Graph object, but does not include Filters, just as it doesn't know what media type will be played. Once the media type is known, it returns the IGRAPHBuilder interface to create a Filter Graph. The status of media playback, stop, suspension can be obtained by querying the iMediaControl interface. Since Windows CE usually supports the process in the process, CLSCTX_INPROC_SERVER is only a valid server created by COCREATEINSTANCE, and other calls will return E_NOTIMPL.

IGRAPHBuilder is used to create a filter graph, add or remove Filters from it, enumerate all Filters in the Filter Graph, enforce the connection when adding Filter. We can use their renderfile methods to create Graph. The final GRAPH structure has since the video or audio format included in the source file. Finally, we can play back files using iMediaController :: Run. If we want the app to wait for play, we can add iMediaEvent :: waitfornetompletion.

For more information

Additional Information

You can find more information about Windows CE DXPAK in the following URL. http://www.microsoft.com/presspass/press/2000/FEB00/DXPACKPR.ASP.

转载请注明原文地址:https://www.9cbs.com/read-5060.html

New Post(0)