CN101521775A - Streaming media playing method based on DireotShow platform - Google Patents

Streaming media playing method based on DireotShow platform Download PDF

Info

Publication number
CN101521775A
CN101521775A CN200910038210A CN200910038210A CN101521775A CN 101521775 A CN101521775 A CN 101521775A CN 200910038210 A CN200910038210 A CN 200910038210A CN 200910038210 A CN200910038210 A CN 200910038210A CN 101521775 A CN101521775 A CN 101521775A
Authority
CN
China
Prior art keywords
standard
input source
video
picture
sound accompaniment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN200910038210A
Other languages
Chinese (zh)
Other versions
CN101521775B (en
Inventor
王玉
陈杨昆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Gadmei Intelligent Technology Co., Ltd.
Original Assignee
GADMEI ELECTRONICS TECHONLOGY CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GADMEI ELECTRONICS TECHONLOGY CO Ltd filed Critical GADMEI ELECTRONICS TECHONLOGY CO Ltd
Priority to CN2009100382109A priority Critical patent/CN101521775B/en
Publication of CN101521775A publication Critical patent/CN101521775A/en
Application granted granted Critical
Publication of CN101521775B publication Critical patent/CN101521775B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Circuits (AREA)

Abstract

The invention discloses a streaming media playing method based on a DireotShow platform, which comprises the following steps of: selection of a video system, in which a system of a video stream input source is identified, the identified system is compared with a system of an initial input source, an equipment controller stops working if the system has been changed, equipment parameters are modified to ensure that the system is the same as that of the corresponding input source, and video steam continues to be transmitted according to the modified system standard; and selection of a sound system, in which an original sound is produced according to each country code with a PAL or SECAM system during channel scanning, each original sound corresponds to a frequency, a plurality of the sounds and a plurality of the frequencies form a channel list, whether the system of the video stream input source is the PAL or SECAM system is judged, if so, the sound corresponding to the frequency which corresponds to the country code is read from the channel list according to the country code corresponding to the video stream input source, and is sent to a current equipment drive, and corresponding audio is modulated by current equipment.

Description

A kind of flow media playing method based on the DireotShow platform
Technical field
The present invention relates to the player method of Streaming Media, especially a kind of flow media playing method based on the DireotShow platform.
Background technology
The rise of the popular and home entertaining of computer must drive the growth of home entertaining E-consumer.DirectShow is as the playback of handling the media file of various forms on the windows platform, a system platform of the multimedia application of the contour performance requirement of audio-video collection.It supports diversified media file format, comprises ASF, MPEG, AVI, MP3 and wav file, supports to use WDM driving or early stage VFW to drive the collection of carrying out media stream simultaneously.DirectShow has integrated other DirectX technology, can automatically detect and use available audio frequency and video hardware-accelerated, also can support not have hardware-accelerated system.DirectShow has simplified media playback, format conversion and collecting work greatly.But meanwhile, it also provides the bottom current control framework for user-defined solution, supports the new file format or the DirectShow assembly of other purposes thereby the user can be created voluntarily.The several typical cases of DirectShow use: DVD player, video editing application, AVI are to ASF transducer, MP3 player and digital video acquisition applications.DirectShow is based upon on the The Component Object Model (COM), and DirectShow provides the DirectShow assembly of most of needs.
At present, there are three kinds of standards of PAL/SECAM/NTSC in the whole world, because there is incompatible situation in the standard difference of using, the standard that they are supported is: PAL/SECAM:720X57650Hz625 line, NTSC:720X48060Hz525 line.Video frequency collection card has different input terminals, as: TV/Video/SVideo, the signaling mode of their inputs may be different, in the process of conversion input source, because the standard of two input sources can be different, and current like product does not all have the standard recognition function, if the current device parameter is set to NTSC, the standard of actual input source is PAL, similar software does not recognize standard and changes, green screen phenomenon appears, otherwise, if link parameter is set to PAL, actual input source is NTSC, the junk data of 100 multi-thread data can appear in the image bottom, if therefore Intelligent Recognition standard not in the process of conversion input can produce image and show mistake; On the other hand, different regions at home, the sound accompaniment difference of the signal of local TV operator emission, it is tuning that segmentation scheme adopts IC to come, the tuning data that different sound accompaniments is corresponding different, the sound accompaniment that needs the software setting correspondence is to driving, drive could be correct tuning, otherwise audio distortions appears, present similar software is not all considered the problem of sound accompaniment, cause a lot of schemes different local owing to audio distortions also can't be carried out, so the diversity of sound accompaniment has determined local radio station can not unify in transmission signal sound accompaniment standard, if the sound accompaniment standard is wrong, sound will distortion.
Summary of the invention
The objective of the invention is to overcome in the prior art because input signal source standard difference exists the incompatible image that causes to show problem wrong, audio distortions, provide a kind of energy by selecting suitable input source standard, carry out corresponding image and audio conversion flow media playing method again based on the DireotShow platform to realize that image correctly shows, sound accompaniment is precisely play.
For realizing above purpose, the present invention has taked following technical scheme: a kind of flow media playing method based on the DireotShow platform includes following steps:
(1) video formats is selected
S1: the standard of identification video stream input source;
S2: the standard that identifies and the standard in initial input source are compared, if standard changes, device controller quits work, and revises device parameter with identical with the standard of corresponding input source, and video flowing continues transmission according to amended standard;
(2) sound accompaniment standard is selected
S1: during channel scanning, according to original sound accompaniment of each national code generation of PAL or Sequential Color and Memory system formula, the corresponding frequency of each original sound accompaniment, above-mentioned a plurality of sound accompaniments and a plurality of frequency form channel list;
S2: whether the standard of judging the video flowing input source is PAL or Sequential Color and Memory system formula, if, then from channel list, read the sound accompaniment of this national code correspondent frequency correspondence according to the national code of video flowing input source correspondence, this sound accompaniment is sent to current device drive, current device modulates corresponding audio frequency.
In image conversion process, the first standard of the current input source of identification, if current be PAL/SECAM, according to PAL/SECAM data stream size is set and is: 720X576, NTSC:720X480 is provided with their corresponding parameters to equipment.Detailed process is: video equipment change input source, TV "=" Composite "=" SVideo "=" TV switches mutually, preserve the standard of original video stream, by the IAMAnalogVideoDecoder interface of DirectShow or directly by equipment input control (Device Io Control) mode fetch equipment standard register, standard more originally, if standard changes, device controller (device capture) quits work, the video flowing transmission stops, (PAL/SECAM is provided with data stream size to the video flowing size modification: 720 X 576 for corresponding standard size, NTSC:720 X 480), the IAMStreamConfig interface of controller output pin is set, video flowing output size is provided with to device controller, device controller is started working, and video flowing transmits according to the standard size of correspondence.
In non-NTSC country, in the time of channel scanning earlier according to national code (China: 86, sound accompaniment: D/K) produce an original sound accompaniment and correspond to channel.The user can revise the sound accompaniment and the preservation of characteristic frequency according to local conditions.When tuned frequency, at first judge whether country into non-NTSC by national code, if, the then sound accompaniment of from channel list, reading current frequency correspondence earlier.Be set to the driving bottom by the IAMAnalogVideoDecoder interface, device controller modulates corresponding audio frequency.
Broken colour OSD shows that the software in the current same industry adopts the display mode of founding window aspect the OSD demonstration, all be to do a display window again, in adjusting the process of volume etc., the OSD single color shows that its OSD shows makes the user feel there is not innervation, more stiff; For addressing this problem, the mode that can make OSD use broken colour in display image shows, with the display image one, seem vividly understandable, realize that each video Sample (unpacked format) of this mode has a frame image data, broken colour OSD is actual to be exactly the pixel value that the character stack image pixel that is about to assigned address is replaced into display image.Therefore the present invention also provides the method that the OSD multilevel color image shows, its step is as follows:
S1: store two equirotal pictures of shape in advance, wherein one is the mask picture, and this mask picture comprises demonstration look and two kinds of pure colors of Transparent color, another colour picture for superposeing and showing;
S2: read the colour picture RGB numerical value of storage, and convert yuv data to and be saved in array, wherein data arrangement is that a RGB point is converted to four Bit data in proper order, and front three is respectively: YUV, the 4th for whether the explicit identification position;
S3: read the Mask picture, the picture point of Mask picture and the contrast of the Transparent color of setting if not Transparent color, are masked as 1, otherwise are 0;
S4: the coloured image that shows of will superposeing is added on the frame original image, obtains the initial data that a frame need superpose, and calculates the value of beginning summing point;
S5: read the sign position of Mask picture corresponding points, if nontransparent point, the value of the corresponding points in the original image is replaced with the value of coloured image corresponding points, if be brocken spectrum, data remain unchanged;
S6: after stack was finished, frame data transmitted backward and show.
Broken colour stack is at YUY2, UYVY, and the original data stream of YVYU form replaces with the OSD color image data that will show with the initial data of correspondence position, and the coloured image that OSD is shown is stored according to certain path earlier.In order to show difform picture, store two equirotal pictures of shape in advance.One is mask figure, and mask shows (a kind of color is for showing look, and another is a Transparent color), another colour picture for superposeing and showing with two kinds of pure colors.
Read the colour picture RGB numerical value of storage, convert yuv data to by RGB and YUV conversion formula and be saved in array, data arrangement is converted to 4 Bit data for (a RGB point) each pixel in proper order, front three is respectively: YUV, the 4th for whether the explicit identification position, read the Mask picture, the Transparent color that the picture point contrast of Mask picture is provided with, if not Transparent color, be masked as 1, otherwise be that 0. will the superpose coloured image that shows is added on the frame original image, at first obtain the initial data that a frame need superpose, calculate the value of beginning summing point then, read the sign position of Mask picture array corresponding points, if nontransparent point, the value of the corresponding points in the original image is replaced with the value of coloured image corresponding points, if remain unchanged for the brocken spectrum data.After stack was finished, frame data transmitted backward and show.
The present invention compared with prior art has following advantage: the flow media playing method based on the DireotShow platform of the present invention is intelligent more, has solved user function software loaded down with trivial details once more after switching input source, has reduced user's operation complexity; Being provided with of audio mode solved different regions, and the difference of sound accompaniment produces audio distortions, has more compatibility; Colored OSD shows can increase the innervation of operating, and the aesthetics of enhancing software has increased specific demand satisfying on the basis of standard, and whole proposal has more hommization, and more close user has effectively solved the incompatible problem of different systems.
Description of drawings
Fig. 1 is an image transitions schematic flow sheet of the present invention;
Fig. 2 regulates schematic flow sheet for sound accompaniment of the present invention;
Fig. 3 is an OSD image processing schematic flow sheet of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments content of the present invention is described in further details.
Embodiment:
See also illustrated in figures 1 and 2ly, a kind of flow media playing method based on the DireotShow platform includes that video formats is selected and the sound accompaniment standard is selected, and wherein video formats selection implementation procedure is as follows:
In image conversion process, discern the standard of current input source earlier, the standard that identifies and the standard in initial input source are compared, if standard changes, device controller quits work, and revise device parameter with identical with the standard of corresponding input source, video flowing continues transmission according to amended standard; If standard does not change, then video flowing is by former standard transmission; For example current is PAL/SECAM, according to PAL/SECAM data stream size is set and is: 720 X 576, and NTSC:720 X 480 is provided with their corresponding parameters to equipment, below is the program that present embodiment specific implementation video formats is selected:
SetCrossbar (inCrossabr); // corresponding input source is set
Sleep (800); // stop to wait for that the time must be enough, otherwise the video formats that obtains
Wrong
Video_Resolution?inVideo=SINGLE_NTSC;
if(pCGM208)
{
InVideo=pCGM208-〉GetVideoFormat (); // directly read the driving standard
}
switch(inVideo)
{
case?SINGLE_NTSC:
SetVideoResolution (sNTSC_M); // standard is provided with to driving
PGlobalData-〉g_nSVideoPAL=sNTSC_M; // preserve current standard
if (pGlobalData->g_nVideoStreamSizeMode==
sVideoStreamSizeMode_720?x?576)
{
pGlobalData->g_nVideoStreamSizeMode=sVideoStreamSizeMode_720?x?480;
// the video flowing size is set
}
Break;
case?SINGLE_NTSC_433:
SetVideoResolution(sNTSC_433);
pGlobalData->g_nSVideoPAL=sNTSC_433;
if (pGlobalData->g_nVideoStreamSizeMode==
sVideoStreamSizeMode_720?x?576)
{
pGlobalData->g_nVideoStreamSizeMode=sVideoStreamSizeMode_720?x?480;
}
break;
case?SINGLE_PAL:
SetVideoResolution(sPAL_D);
pGlobalData->g_nSVi?deoPAL=sPAL_D;
if (pGlobalData->g_nVideoStreamSizeMode==
sVideoStreamSizeMode_720?x?480)
{
pGlobalData->g_nVideoStreamSizeMode=sVideoStreamSizeMode_720?x?576;
}
break;
case?SINGLE_SECAM:
SetVideoResolution(sSECAM_B);
pGlobalData->g_nSVideoPAL=sSECAM_B;
if (pGlobalData->g_nVideoStreamSizeMode==
sVideoStreamSizeMode_720?x?480)
{
pGlobalData->g_nVideoStreamSizeMode=sVideoStreamSizeMode_720?x?576;
}
break;
}
if?(nVideoStreamSize==pGlobalData->g_nVideoStreamSizeMode)
return?StartPreview();
else
Return SetStreamNum (); // video formats changes, and equipment and link need again
Parameter is set
Wherein sound accompaniment standard selects implementation procedure as follows:
Elder generation produces an original sound accompaniment according to each national code of PAL or Sequential Color and Memory system formula during channel scanning, need the user to adjust corresponding sound accompaniment, accomplish once to adjust, the permanent preservation according to actual conditions, the corresponding frequency of each original sound accompaniment, above-mentioned a plurality of sound accompaniments and a plurality of frequency form channel list; Whether the standard of judging the video flowing input source is PAL or Sequential Color and Memory system formula, if, then from channel list, read the sound accompaniment of this national code correspondent frequency correspondence according to the national code of video flowing input source correspondence, and send to driving (tuning time send to driving) to sound accompaniment, modulate corresponding audio frequency by device controller.
Below be the program that present embodiment specific implementation sound accompaniment standard is selected:
BOOL?bPALFormat=IsPALFormat();
If (bPALFormat) // whether be PAL/SECAM standard country or regional
{
if(strcmp(sOldChannelForamt,pChannelMsg->sPal)!=0)//
Relatively whether the standard of current channel and current device is identical
{
if?(pVideoManagerSystem)
{
PVideoManagerSystem-〉SetChannelFormat (pChannelMsg-〉sPal); // current
The channel standard is provided with to driving
}
Strcpy (sOldChannelForamt, pChannelMsg-〉sPal); // current channel
Standard saves as the channel standard.
}
}
When current industry is done the OSD demonstration, adopt the display mode of founding window, the OSD operation all is to show single color, OSD shows makes the user feel there is not innervation, more stiff, see also shown in Figure 3ly, present embodiment provides method that a kind of OSD multilevel color image shows to address the above problem, and its step is as follows:
If (m_pOSDFilter) // current OSD Filter exists
The parameter of { // be provided with OSD is given Fi lter, the length that the current OSD of iNewPos need show.Instartpos: the initial seat (must be provided with) of displaying contents //RGB (0,0,0) //color of OSD OSD picture, the color that RGB (255,0,0) OSD picture does not show,
SPathName: //path of OSD picture, nLen: the length in path, the time that nShowTimer:OSD shows, the S of unit)
if(m_pOSDFilter->OSDVolumeValue(iNewPos,inStartPos,RGB(0,0,0),
RGB(255,0,0),sPathName,nLen,nShowTimer))
{
return?TRUE;
}
}
Above-listed detailed description is at the specifying of possible embodiments of the present invention, and this embodiment is not in order to limiting claim of the present invention, and the equivalence that all the present invention of disengaging do is implemented or change, all should be contained in the claim of this case.

Claims (2)

1, a kind of flow media playing method based on the DireotShow platform is characterized in that, includes following steps:
(1) video formats is selected
S1: the standard of identification video stream input source;
S2: the standard that identifies and the standard in initial input source are compared, if standard changes, device controller quits work, and revises device parameter with identical with the standard of corresponding input source, and video flowing continues transmission according to amended standard;
(2) sound accompaniment standard is selected
S1: during channel scanning, according to original sound accompaniment of each national code generation of PAL or Sequential Color and Memory system formula, the corresponding frequency of each original sound accompaniment, above-mentioned a plurality of sound accompaniments and a plurality of frequency form channel list;
S2: whether the standard of judging the video flowing input source is PAL or Sequential Color and Memory system formula, if, then from channel list, read the sound accompaniment of this national code correspondent frequency correspondence according to the national code of video flowing input source correspondence, this sound accompaniment is sent to current device drive, current device modulates corresponding audio frequency.
2, the flow media playing method based on the DireotShow platform as claimed in claim 1 is characterized in that, also includes the step that the OSD multilevel color image shows:
S1: store two equirotal pictures of shape in advance, wherein one is the mask picture, and this mask picture comprises demonstration look and two kinds of pure colors of Transparent color, another colour picture for superposeing and showing;
S2: read the colour picture RGB numerical value of storage, and convert yuv data to and be saved in array, wherein data arrangement is that a RGB point is converted to four Bit data in proper order, and front three is respectively: YUV, the 4th for whether the explicit identification position;
S3: read the Mask picture, the picture point of Mask picture and the contrast of the Transparent color of setting if not Transparent color, are masked as 1, otherwise are 0;
S4: the coloured image that shows of will superposeing is added on the frame original image, obtains the initial data that a frame need superpose, and calculates the value of beginning summing point;
S5: read the sign position of Mask picture corresponding points, if nontransparent point, the value of the corresponding points in the original image is replaced with the value of coloured image corresponding points, if be brocken spectrum, data remain unchanged.
CN2009100382109A 2009-03-27 2009-03-27 Streaming media playing method based on DireotShow platform Expired - Fee Related CN101521775B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100382109A CN101521775B (en) 2009-03-27 2009-03-27 Streaming media playing method based on DireotShow platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100382109A CN101521775B (en) 2009-03-27 2009-03-27 Streaming media playing method based on DireotShow platform

Publications (2)

Publication Number Publication Date
CN101521775A true CN101521775A (en) 2009-09-02
CN101521775B CN101521775B (en) 2011-01-12

Family

ID=41082119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100382109A Expired - Fee Related CN101521775B (en) 2009-03-27 2009-03-27 Streaming media playing method based on DireotShow platform

Country Status (1)

Country Link
CN (1) CN101521775B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872418A (en) * 2016-03-30 2016-08-17 浙江大华技术股份有限公司 Method and device for superimposing a GUI (Graphical User Interface) image layer on a digital image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872418A (en) * 2016-03-30 2016-08-17 浙江大华技术股份有限公司 Method and device for superimposing a GUI (Graphical User Interface) image layer on a digital image

Also Published As

Publication number Publication date
CN101521775B (en) 2011-01-12

Similar Documents

Publication Publication Date Title
CN100531291C (en) Method and system for mastering and distributing enhanced color space content
CN112822537B (en) Method, apparatus and medium for adapting video content to display characteristics
CN106105177B (en) Transform method and converting means
CN103597812B (en) Graphic processing apparatus and method for high dynamic range video
US7724271B2 (en) Apparatus and method of transforming multidimensional video format
US8417099B2 (en) Multiplexing method and recording medium
CN102117631B (en) System and method for playing multimedia
CN106165403A (en) Data output device, data output method and data creation method
EP1617370A1 (en) Image format transformation
CN110460743A (en) Display device, converting means, display methods, playing device, playback method
CN102034406B (en) Methods and devices for displaying multimedia data
CN1306724A (en) Wide-band multi-format audio/video prodn system with frame-rate conversion
CN109691116A (en) Image display and image display method
CN1148770A (en) Digital video data coding and decoding device removing caption data noise, and method thereof
CN101902553A (en) Expansion module and television having the same
CN105979370B (en) A kind of method and device configuring image model
CN103702054A (en) Visualization method and visualization device for multi-channel signal source and television
CN103167257A (en) Display device, display method, transmitting device and transmitting method
CN101094369A (en) Method for switching display modes of digital TV set
CN110187858B (en) Image display method and system
CN103997677B (en) A kind of player method and playback equipment of audio frequency and video
CN101521775B (en) Streaming media playing method based on DireotShow platform
KR100246762B1 (en) Decoding method for video data
CN1980400A (en) Image capture apparatus and method, recording medium for memorizing program executing the method
JP3939850B2 (en) Apparatus for processing control command sequence, method for generating control command sequence, and storage medium for storing control command sequence

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180124

Address after: B 511542 workshop in Guangdong province Qingyuan city Yinzhan forest Youtu Road No. 1 Qingyuan Gadmei Electronic Technology Co. Ltd.

Patentee after: Guangdong Gadmei Intelligent Technology Co., Ltd.

Address before: 511542 Guangdong province Qingyuan City silver light

Patentee before: Gadmei Electronics Techonlogy Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110112

Termination date: 20190327