Summary of the invention
In view of the above problems, it proposes the embodiment of the present application and overcomes the above problem or at least partly in order to provide one kindA kind of video data method for pushing based on mobile terminal to solve the above problems and a kind of corresponding view based on mobile terminalFrequency is according to driving means.
To solve the above-mentioned problems, the embodiment of the present application discloses a kind of video data push side based on mobile terminalMethod, wherein the mobile terminal have built-in media player object, preset system-level server object, and, numberWord living network alliance DLNA server object;The mobile terminal is communicatively coupled with digital media player DMP;
The method includes:
Video data to be processed is obtained via the media player object built in the mobile terminal;
Call the system-level server object by the video data transmission to the Digital Life Network AllianceDLNA server object;
Via the Digital Life Network Alliance DLNA server object by the video data transmission extremely and when ForwardThe digital media player DMP that dynamic terminal is communicatively coupled.
Preferably, the preset system-level server object succession has Android Interface Definition Language AIDL literaryPart includes media player object data transmission interface in the Android Interface Definition Language AIDL file, described system-levelServer object realizes the media player object data transmission interface;
The media player object obtains the system-level service routine by using interprocess communication Binder mechanismThe media player object data transmission interface that object is realized, the communication with the system-level service.
Preferably, the preset system-level server object is provided with initialization interface Init, and mobile terminal is openingWhen dynamic, the system-level server object is started by the initialization interface Init.
Preferably, it is described via the Digital Life Network Alliance DLNA server object by the video data transmissionInclude: to the step of digital media player DMP being communicatively coupled with current mobile terminal
The connected Digital Media of present terminal is searched via the Digital Life Network Alliance DLNA server object to broadcastPut device DMP;
It is shown to user and shows found digital media player DMP;
Receive the instruction that user is used for designation number media player DMP;
To digital media player DMP transmitting video data specified by the instruction.
Preferably, the video data includes: mobile terminal local video data and network video data.
Preferably, when the video data is mobile terminal local video data, the Digital Life Network AllianceDLNA service carries out HTTP agreement by the absolute path to the mobile terminal local video data and shares, by the movementTerminal local video data is shared to digital media player DMP.
Preferably, when the video data is network video data, the media player object obtains the networkThe uniform resource position mark URL of video data;The uniform resource position mark URL is sent to institute by the media player objectSystem-level server object is stated, the system-level server object uses broadcast mode by the uniform resource locatorURL is sent to the Digital Life Network Alliance DLNA server object;Digital media player DMP passes through the numberLiving network alliance DLNA server object obtains network video data corresponding to the uniform resource position mark URL.
Meanwhile disclosed herein as well is a kind of video data driving means based on mobile terminal, wherein it is described it is mobile eventuallyHolding has built-in media player object, preset system-level server object, and, Digital Life Network Alliance DLNAServer object;The mobile terminal is communicatively coupled with digital media player DMP;
The device includes:
Module is obtained, for obtaining video counts to be processed via the media player object built in the mobile terminalAccording to;
First transmission module calls the system-level server object that the video data transmission is raw to the numberNetwork alliance DLNA server object living;
Second transmission module, for via the Digital Life Network Alliance DLNA server object by the video countsAccording to being transmitted to the digital media player DMP being communicatively coupled with current mobile terminal.
Preferably, the preset system-level server object succession has Android Interface Definition Language AIDL literaryPart includes media player object data transmission interface in the Android Interface Definition Language AIDL file, described system-levelServer object realizes the media player object data transmission interface;
The media player object obtains the system-level service routine by using interprocess communication Binder mechanismThe media player object data transmission interface that object is realized, the communication with the system-level service.
Preferably, the preset system-level server object is provided with initialization interface Init, and mobile terminal is openingWhen dynamic, the system-level server object is started by the initialization interface Init.
The embodiment of the present application includes the following advantages:
The embodiment of the present application is passed by the video that the media player object built in mobile terminal is played mobile terminalIt is defeated to arrive system-level server object, Digital Life Network Alliance DLNA is transmitted the video to by system-level server objectServer object transmits the video to television by Digital Life Network Alliance DLNA server object, by smaller screen to greatlyThe video playing of the conversion of screen greatly improves the viewing experience of user;
No matter the video of mobile terminal playing is network video or local video, can pass through the embodiment of the present applicationMethod realizes Digital Life Network Alliance DLNA service transmission.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific realApplying mode, the present application will be further described in detail.
DLNA (DIGITAL LIVING NETWORK ALLIANCE, Digital Life Network Alliance), it is intended to solve personalPC, consumer appliances, wireless network and cable network including mobile device interconnect.
DNLA product includes: digital media server (DMS, Digital Media Server), digital media player(DMP, Digital Media Player);
Digital media server DMS: acquisition, recording, storage and the equipment as source of media file, example are providedSuch as mobile terminal.
The equipment that digital media player DMP: can search and play or export any media file as provided by DMS,Such as television terminal, family's theater etc..
Traditional DLNA service only handles the video resource that DMS is shared in local and other same local area networks, for example, beatingYouku.com's webpage is opened, some video is played, since youku.com's background server is not DMS, is unlikely in same office with mobile phoneIn the net of domain, DLNA agreement can not access its video resource.To realize at present Internet resources push can only by other agreements,As http protocol access youku.com backstage obtain data, then by certain agreement be transferred to television complete broadcasting.But youku.comBackstage do not open for free, unless paying the cooperative relationship that certain expense reaches manufacturer, other video producers are equally such asThis, so that video push causes great limitation.
One of the core concepts of the embodiments of the present application is that will be moved by the media player object built in mobile terminalThe transmission of video that terminal is played transmits the video to number to system-level server object, by system-level server objectWord living network alliance DLNA server object, is transmitted the video to by Digital Life Network Alliance DLNA server objectTelevision.
Referring to Fig.1, the step of showing a kind of video data method for pushing embodiment based on mobile terminal of the applicationFlow chart, wherein the mobile terminal have built-in media player object, preset system-level server object, withAnd Digital Life Network Alliance DLNA server object;The mobile terminal and digital media player DMP carry out communication linkIt connects, the method can specifically include following steps:
Step 101, video data to be processed is obtained via the media player object built in the mobile terminal;
Step 102, call the system-level server object by the video data transmission to the digital living netNetwork alliance DLNA server object;
Step 103, via the Digital Life Network Alliance DLNA server object by the video data transmission extremelyThe digital media player DMP being communicatively coupled with current mobile terminal.
After media player object is in preparation prepared state, using media player object to current video numberAccording to being recorded, video data is given to system-level server object, shape of the final system grade server object to broadcastFormula passes to Digital Life Network Alliance DLNA server object.
In the video playing normal process of Android mobile terminal, video playing is had to by mobile terminal systemThe built-in media player object of the bottom is just able to achieve;The resource of third-party server such as video web page, it is usedThe player of Webview finally will also pass through the built-in media player object of the bottom.Thus in this application, pass through most bottomThen the related broadcasting link of the built-in media player object intercepting page video of layer, such as URL pass through DLNA service routine againDigital media player DMP is sent by this link.
In a kind of preferable example of the embodiment of the present application, the video data may include: mobile terminal local videoData and network video data.Traditional DLNA service only handles the view that DMS is shared in local and other same local area networksFrequency resource, and the application can also be shared Internet resources by the built-in media player object of the bottom.
Media player object is the program under Framework layers of Android frame, specific location such as: FrameworkLayer Frameworks/base/media/java/android/media/.DLNA service is upper layer application clothes in the terminalBusiness program, the program that Framework layers of Yao Shixian frame is communicated with upper layer application service routine to be needed to obtain contextContext, and only have in Systemserver layers of system-level service in Framework layers of frame and have context Context.Therefore it add-on system grade server object, media player object can be tied up in Systemserver layers of system-level serviceSystem-level server object is determined to obtain the context Context of system-level Systemserver layers of service, realizes that media are broadcastDevice object is put to communicate with the striding course of DNLA.
In a kind of preferable example of the embodiment of the present application, the preset system-level server object succession hasAndroid Interface Definition Language AIDL file includes media player in the Android Interface Definition Language AIDL fileObject data coffret, the system-level server object realize the media player object data transmission interface;
The media player object obtains the system-level service routine by using interprocess communication Binder mechanismThe media player object data transmission interface that object is realized, the communication with the system-level service.
The step of add-on system grade server object, can specifically include: establish system under Framework layers of frameGrade server object catalogue, the service catalogue include Android Interface Definition Language AIDL (Android InterfaceDefInition Language) file, the interface that AIDL file has media player object to transmit data;Service catalogue also wrapsJava file containing system-level server object, system-level server object inherit aidl file and need to realize AIDL'sInterface.
Media player object can be by interprocess communication Binder mechanism binding system grade server object, specificallyStep may include: that media player object passes through the system-level server object of service managerZ-HU ServiceManger acquisitionBasic interface Ibinder, and then obtain the interface in the AIDL that system-level server object is realized, complete player and beThe communication of irrespective of size service.
In a kind of preferable example of the embodiment of the present application, the preset system-level server object is provided with initiallyChange interface Init, mobile terminal starts the system-level server object on startup, by the initialization interface Init.
Enter Android Init process after linux kernel starting when booting, and then passes through system-level serviceSystemserver layers of starting other phase relation irrespective of size services.In the embodiment of the present application, system-level server object opensDynamic process addition exists: Frameworks/base/services/java/com/android/server/In SystemServer.java.
The initialization of addition is called to connect in the startOtherService interface of system-level systemserver layers of serviceMouthful Init completes addition to system-level server object and system-level systemserver layers of service in the interfaceThe transparent transmission of context Context.
In a kind of preferable example of the embodiment of the present application, the step 103 can specifically include following sub-step:
Sub-step S11 searches what present terminal was connected via the Digital Life Network Alliance DLNA server objectDigital media player DMP;
User is searched under same local area network by Digital Life Network Alliance DLNA server object can pushing videoDigital media player DMP;
Sub-step S12 shows to user and shows found digital media player DMP;
Digital Life Network Alliance DLNA server object is by the digital media player DMP searched with list sideFormula is shown, is selected for user;
Sub-step S13 receives the instruction that user is used for designation number media player DMP;
The instruction of Digital Life Network Alliance DLNA server object user selects the digital media player to be pushedDMP。
Sub-step S14, to digital media player DMP transmitting video data specified by the instruction.
The digital media player DMP transmitting video data specified to user.
Traditional Digital Life Network Alliance service needs to be integrated into third-party application, first to local video resource intoRow is all shared, and obtains the push of realization video after list related, and is single to a certain determination in the embodiment of the present applicationThe data sharing and generation respective labels Meta information of file, as the ID of mobile terminal is identified;
In a kind of preferable example of the embodiment of the present application, when the video data is mobile terminal local video dataWhen, the Digital Life Network Alliance DLNA service is carried out by the absolute path to the mobile terminal local video dataHttp protocol is shared, and the mobile terminal local video data is shared to digital media player DMP.
When the video data is network video data, the media player object obtains the network video dataUniform resource position mark URL;The uniform resource position mark URL is sent to described system-level by the media player objectThe uniform resource position mark URL is sent to by server object, the system-level server object using broadcast modeThe Digital Life Network Alliance DLNA server object;Digital media player DMP is joined by the digital living networkAlliance's DLNA server object obtains network video data corresponding to the uniform resource position mark URL.
Media player object does not record the classification of video, and the type of video is serviced by Digital Life Network Alliance DLNAProgram object is distinguished, and local resource is all absolute path, without the uniform resource position mark URLs network identity such as http, and theThe resource of tripartite's server has uniform resource position mark URL network identity, Digital Life Network Alliance DLNA service routine pairAs according to being absolute path or distinguish the classification of video resource with network identity.
For local resource, Digital Life Network Alliance DLNA server object can be according to absolute where video resourcePath realizes that data network is shared to the resource, and mobile terminal is allowed to access the resource with digital media player DMP and carry outIt plays, if it is Internet resources, then does not need to be shared, but require supplementation with mobile terminal ID mark, to complete dataTransmission.
It is the schematic diagram that mobile terminal is communicated with television terminal in the embodiment of the present application referring to Fig. 2.
In television terminal when in the state for waiting terminal searches multicast signal, mobile terminal is sent to television terminalFor search for can communication terminal search end command;
Television terminal sends the unicast search terminal signaling for responding above-mentioned search end command to mobile terminal;
Mobile terminal receives unicast and searches terminal signaling, and shows to user and have sent the TV that terminal signaling is searched in unicastTerminal;
After user chooses the television terminal to be communicated, mobile terminal is in the television terminal hair for waiting connection statusSend connection terminal signaling;
Television terminal receives the connection terminal signaling, and the SOT state of termination of itself is sent to mobile terminal;
Mobile terminal according to television terminal state to television terminal transmitting video data;
Television terminal receives video data and plays;
During video data transmission, mobile terminal and television terminal keep interaction mode communication.
Referring to Fig. 3 be in the embodiment of the present application mobile terminal by DLNA service to television terminal send video signalFigure.Multi-screen interactive application program for the video of mobile terminal to be shared to television terminal is installed on mobile terminal, it is mobileTerminal have built-in media player object, preset system-level server object, and, Digital Life Network AllianceDLNA server object;Mobile terminal and television terminal are under same local area network, and television terminal has the function of DLNA;
Mobile terminal-opening after multi-screen interactive application program receives booting broadcast, detects whether to open multi-screen interactive journeyThe switch of sequence, multi-screen interactive program, which is realized, shares to television terminal for the video of mobile terminal.
If not opening the switch of multi-screen interactive program, user is waited to open;
If having turned on the switch of multi-screen interactive program, multi-screen interactive program is opened;
After multi-screen interactive program is opened, DLNA program object can push around mobile terminal to search television terminal;
When mobile terminal playing video, the video counts that current mobile terminal plays are obtained by media player objectAccording to;
When DLNA program object searches the television terminal that can be pushed, taken by preset Framework series of strata irrespective of sizeThe broadcast address for the video data that media player obtains is sent DLNA server object by business program object;
Shared processing is carried out to video data by Digital Life Network Alliance DLNA server object;
At this point, mobile terminal sends the prompt for whether needing to play out video push to television terminal to user;
It needs video push in user's confirmation to television terminal, and after choosing and needing the television terminal that pushes, movesVideo data is pushed to television terminal by DLNA server object by terminal;
Mobile terminal data-pushing on the way, can receive television terminal transmission instruction and user operational order;
When mobile terminal shutdown, stop transmission.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the methodIt closes, but those skilled in the art should understand that, the embodiment of the present application is not limited by the described action sequence, because according toAccording to the embodiment of the present application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also shouldKnow, the embodiments described in the specification are all preferred embodiments, and related movement not necessarily the application is implementedNecessary to example.
Referring to Fig. 4, a kind of structure of video data driving means embodiment based on mobile terminal of the application is shownBlock diagram, wherein the mobile terminal have built-in media player object, preset system-level server object, and,Digital Life Network Alliance DLNA server object;The mobile terminal is communicatively coupled with digital media player DMP;
Described can specifically include following module:
Module 401 is obtained, for obtaining video to be processed via the media player object built in the mobile terminalData;
First transmission module 402 calls the system-level server object by the video data transmission to the numberWord living network alliance DLNA server object;
Second transmission module 403, for via the Digital Life Network Alliance DLNA server object by the viewFrequency evidence is transmitted to the digital media player DMP being communicatively coupled with current mobile terminal.
In a kind of preferable example of the embodiment of the present application, the preset system-level server object succession hasAndroid Interface Definition Language AIDL file includes media player in the Android Interface Definition Language AIDL fileObject data coffret, the system-level server object realize the media player object data transmission interface;
The media player object obtains the system-level service routine by using interprocess communication Binder mechanismThe media player object data transmission interface that object is realized, the communication with the system-level service.
In the embodiment of the present application, the preset system-level server object is provided with initialization interface Init, movesDynamic terminal starts the system-level server object on startup, by the initialization interface Init.
In a kind of preferable example of the embodiment of the present application, second transmission module 403 further comprises following submoduleBlock:
Submodule is searched, for searching present terminal phase via the Digital Life Network Alliance DLNA server objectDigital media player DMP even;
Show submodule, shows found digital media player DMP for showing to user;
Receiving submodule, for receiving instruction of the user for designation number media player DMP;
Specified transmission submodule, to digital media player DMP transmitting video data specified by the instruction.
In a kind of preferable example of the embodiment of the present application, the video data includes: mobile terminal local video dataAnd network video data.
When the video data is mobile terminal local video data, the Digital Life Network Alliance DLNA serviceHttp protocol is carried out by the absolute path to the mobile terminal local video data to share, and the mobile terminal is locally regardedFrequency data sharing is to digital media player DMP.
When the video data is network video data, the media player object obtains the network video dataUniform resource position mark URL;The uniform resource position mark URL is sent to described system-level by the media player objectThe uniform resource position mark URL is sent to by server object, the system-level server object using broadcast modeThe Digital Life Network Alliance DLNA server object;Digital media player DMP is joined by the digital living networkAlliance's DLNA server object obtains network video data corresponding to the uniform resource position mark URL.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simplePlace illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are withThe difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiments of the present application may be provided as method, apparatus or calculatingMachine program product.Therefore, the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software andThe form of the embodiment of hardware aspect.Moreover, the embodiment of the present application can be used one or more wherein include computer canWith in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program codeThe form of the computer program product of implementation.
The embodiment of the present application is referring to according to the method for the embodiment of the present application, terminal device (system) and computer programThe flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructionsIn each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide theseComputer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminalsStandby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devicesCapable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagramThe device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devicesIn computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packetThe manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagramThe function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so thatSeries of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thusThe instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchartAnd/or in one or more blocks of the block diagram specify function the step of.
Although preferred embodiments of the embodiments of the present application have been described, once a person skilled in the art knows basesThis creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted asIncluding preferred embodiment and all change and modification within the scope of the embodiments of the present application.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to byOne entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operationBetween there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaningCovering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrapThose elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, articleOr the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limitedElement, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Above to a kind of video data method for pushing based on mobile terminal and one kind provided herein based on movementThe video data driving means of terminal, is described in detail, used herein principle and reality of the specific case to the applicationThe mode of applying is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;TogetherWhen, for those of ordinary skill in the art, according to the thought of the application, have in specific embodiments and applicationsChange place, in conclusion the contents of this specification should not be construed as limiting the present application.