Ticket #12720: 12720-changes.patch
File 12720-changes.patch, 12.3 KB (added by , 8 years ago) |
---|
-
mythtv/libs/libmyth/programinfo.cpp
diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp index 4d7e25e..23550eb 100644
a b static const char *from_recordedseek_mark_desc = 4019 4019 " AND type = :TYPE" 4020 4020 " AND offset <= :QUERY_ARG" 4021 4021 " ORDER BY chanid DESC, starttime DESC, type DESC, mark DESC LIMIT 1;"; 4022 bool ProgramInfo::QueryKeyFrameInfo(uint64_t * result, uint64_t position_or_keyframe, bool backwards, MarkTypes type, const char *from_filemarkup_asc, const char *from_filemarkup_desc, const char *from_recordedseek_asc,const char *from_recordedseek_desc) const 4022 4023 bool ProgramInfo::QueryKeyFrameInfo(uint64_t * result, 4024 uint64_t position_or_keyframe, 4025 bool backwards, 4026 MarkTypes type, 4027 const char *from_filemarkup_asc, 4028 const char *from_filemarkup_desc, 4029 const char *from_recordedseek_asc, 4030 const char *from_recordedseek_desc) const 4023 4031 { 4024 4032 MSqlQuery query(MSqlQuery::InitCon()); 4025 4033 … … bool ProgramInfo::QueryKeyFrameInfo(uint64_t * result, uint64_t position_or_keyf 4091 4099 4092 4100 } 4093 4101 4094 bool ProgramInfo::QueryPositionKeyFrame(uint64_t *keyframe, uint64_t position, bool backwards) const 4102 bool ProgramInfo::QueryPositionKeyFrame(uint64_t *keyframe, uint64_t position, 4103 bool backwards) const 4095 4104 { 4096 return QueryKeyFrameInfo(keyframe, position, backwards, MARK_GOP_BYFRAME, from_filemarkup_mark_asc, from_filemarkup_mark_desc, from_recordedseek_mark_asc, from_recordedseek_mark_desc); 4105 return QueryKeyFrameInfo(keyframe, position, backwards, MARK_GOP_BYFRAME, 4106 from_filemarkup_mark_asc, 4107 from_filemarkup_mark_desc, 4108 from_recordedseek_mark_asc, 4109 from_recordedseek_mark_desc); 4097 4110 } 4098 bool ProgramInfo::QueryKeyFramePosition(uint64_t *position, uint64_t keyframe, bool backwards) const 4111 bool ProgramInfo::QueryKeyFramePosition(uint64_t *position, uint64_t keyframe, 4112 bool backwards) const 4099 4113 { 4100 return QueryKeyFrameInfo(position, keyframe, backwards, MARK_GOP_BYFRAME, from_filemarkup_offset_asc, from_filemarkup_offset_desc, from_recordedseek_offset_asc, from_recordedseek_offset_desc); 4114 return QueryKeyFrameInfo(position, keyframe, backwards, MARK_GOP_BYFRAME, 4115 from_filemarkup_offset_asc, 4116 from_filemarkup_offset_desc, 4117 from_recordedseek_offset_asc, 4118 from_recordedseek_offset_desc); 4101 4119 } 4102 bool ProgramInfo::QueryDurationKeyFrame(uint64_t *keyframe, uint64_t duration, bool backwards) const 4120 bool ProgramInfo::QueryDurationKeyFrame(uint64_t *keyframe, uint64_t duration, 4121 bool backwards) const 4103 4122 { 4104 return QueryKeyFrameInfo(keyframe, duration, backwards, MARK_DURATION_MS, from_filemarkup_mark_asc, from_filemarkup_mark_desc, from_recordedseek_mark_asc, from_recordedseek_mark_desc); 4123 return QueryKeyFrameInfo(keyframe, duration, backwards, MARK_DURATION_MS, 4124 from_filemarkup_mark_asc, 4125 from_filemarkup_mark_desc, 4126 from_recordedseek_mark_asc, 4127 from_recordedseek_mark_desc); 4105 4128 } 4106 bool ProgramInfo::QueryKeyFrameDuration(uint64_t *duration, uint64_t keyframe, bool backwards) const 4129 bool ProgramInfo::QueryKeyFrameDuration(uint64_t *duration, uint64_t keyframe, 4130 bool backwards) const 4107 4131 { 4108 return QueryKeyFrameInfo(duration, keyframe, backwards, MARK_DURATION_MS, from_filemarkup_offset_asc, from_filemarkup_offset_desc, from_recordedseek_offset_asc, from_recordedseek_offset_desc); 4132 return QueryKeyFrameInfo(duration, keyframe, backwards, MARK_DURATION_MS, 4133 from_filemarkup_offset_asc, 4134 from_filemarkup_offset_desc, 4135 from_recordedseek_offset_asc, 4136 from_recordedseek_offset_desc); 4109 4137 } 4110 4138 4111 4139 /// \brief Store aspect ratio of a frame in the recordedmark table -
mythtv/libs/libmyth/programinfo.h
diff --git a/mythtv/libs/libmyth/programinfo.h b/mythtv/libs/libmyth/programinfo.h index 0503174..dbaed33 100644
a b class MPUBLIC ProgramInfo 627 627 void SavePositionMapDelta(frm_pos_map_t &, MarkTypes type) const; 628 628 629 629 // Get position/duration for keyframe and vice versa 630 bool QueryKeyFrameInfo(uint64_t *, uint64_t position_or_keyframe, bool backwards, MarkTypes type, const char *from_filemarkup_asc, const char *from_filemarkup_desc, const char *from_recordedseek_asc,const char *from_recordedseek_desc) const; 631 bool QueryKeyFramePosition(uint64_t *, uint64_t keyframe, bool backwards) const; 632 bool QueryPositionKeyFrame(uint64_t *, uint64_t position, bool backwards) const; 633 bool QueryKeyFrameDuration(uint64_t *, uint64_t keyframe, bool backwards) const; 634 bool QueryDurationKeyFrame(uint64_t *, uint64_t duration, bool backwards) const; 630 bool QueryKeyFrameInfo(uint64_t *, uint64_t position_or_keyframe, 631 bool backwards, 632 MarkTypes type, const char *from_filemarkup_asc, 633 const char *from_filemarkup_desc, 634 const char *from_recordedseek_asc, 635 const char *from_recordedseek_desc) const; 636 bool QueryKeyFramePosition(uint64_t *, uint64_t keyframe, 637 bool backwards) const; 638 bool QueryPositionKeyFrame(uint64_t *, uint64_t position, 639 bool backwards) const; 640 bool QueryKeyFrameDuration(uint64_t *, uint64_t keyframe, 641 bool backwards) const; 642 bool QueryDurationKeyFrame(uint64_t *, uint64_t duration, 643 bool backwards) const; 635 644 636 645 // Get/set all markup 637 646 struct MarkupEntry -
mythtv/libs/libmythservicecontracts/services/dvrServices.h
diff --git a/mythtv/libs/libmythservicecontracts/services/dvrServices.h b/mythtv/libs/libmythservicecontracts/services/dvrServices.h index 81c02b1..2302a7e 100644
a b 45 45 class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ??? 46 46 { 47 47 Q_OBJECT 48 Q_CLASSINFO( "version" , " 6.1" );48 Q_CLASSINFO( "version" , "7.0" ); 49 49 Q_CLASSINFO( "RemoveRecorded_Method", "POST" ) 50 50 Q_CLASSINFO( "DeleteRecording_Method", "POST" ) 51 51 Q_CLASSINFO( "UnDeleteRecording", "POST" ) … … class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ??? 112 112 const QDateTime &StartTime, 113 113 bool Watched) = 0; 114 114 115 virtual long GetSavedBookmark ( int RecordedId,115 virtual long GetSavedBookmark ( int RecordedId, 116 116 int ChanId, 117 117 const QDateTime &StartTime, 118 118 const QString &OffsetType ) = 0; 119 119 120 virtual bool SetSavedBookmark ( int RecordedId,120 virtual bool SetSavedBookmark ( int RecordedId, 121 121 int ChanId, 122 122 const QDateTime &StartTime, 123 123 const QString &OffsetType, -
mythtv/programs/mythbackend/services/dvr.cpp
diff --git a/mythtv/programs/mythbackend/services/dvr.cpp b/mythtv/programs/mythbackend/services/dvr.cpp index cf62cff..30547cb 100644
a b bool Dvr::UpdateRecordedWatchedStatus ( int RecordedId, 271 271 ///////////////////////////////////////////////////////////////////////////// 272 272 273 273 long Dvr::GetSavedBookmark( int RecordedId, 274 275 276 274 int chanid, 275 const QDateTime &recstarttsRaw, 276 const QString &offsettype ) 277 277 { 278 278 if ((RecordedId <= 0) && 279 279 (chanid <= 0 || !recstarttsRaw.isValid())) … … long Dvr::GetSavedBookmark( int RecordedId, 287 287 uint64_t offset; 288 288 bool isend=true; 289 289 uint64_t position = ri.QueryBookmark(); 290 if (offsettype == "Position"){290 if (offsettype.toLower() == "position"){ 291 291 ri.QueryKeyFramePosition(&offset, position, isend); 292 292 return offset; 293 293 } 294 else if (offsettype == "Duration"){294 else if (offsettype.toLower() == "duration"){ 295 295 ri.QueryKeyFrameDuration(&offset, position, isend); 296 296 return offset; 297 297 } … … long Dvr::GetSavedBookmark( int RecordedId, 304 304 ///////////////////////////////////////////////////////////////////////////// 305 305 306 306 bool Dvr::SetSavedBookmark( int RecordedId, 307 308 309 310 307 int chanid, 308 const QDateTime &recstarttsRaw, 309 const QString &offsettype, 310 long Offset ) 311 311 { 312 312 if ((RecordedId <= 0) && 313 313 (chanid <= 0 || !recstarttsRaw.isValid())) 314 314 throw QString("Recorded ID or Channel ID and StartTime appears invalid."); 315 315 316 if (Offset < 0) 317 throw QString("Offset must be >= 0."); 318 316 319 RecordingInfo ri; 317 320 if (RecordedId > 0) 318 321 ri = RecordingInfo(RecordedId); … … bool Dvr::SetSavedBookmark( int RecordedId, 320 323 ri = RecordingInfo(chanid, recstarttsRaw.toUTC()); 321 324 uint64_t position; 322 325 bool isend=true; 323 if (offsettype == "Position"){326 if (offsettype.toLower() == "position"){ 324 327 if (!ri.QueryPositionKeyFrame(&position, Offset, isend)) 325 328 return false; 326 329 } 327 else if (offsettype == "Duration"){330 else if (offsettype.toLower() == "duration"){ 328 331 if (!ri.QueryDurationKeyFrame(&position, Offset, isend)) 329 332 return false; 330 333 } … … bool Dvr::SetSavedBookmark( int RecordedId, 333 336 ri.SaveBookmark(position); 334 337 return true; 335 338 } 339 336 340 ///////////////////////////////////////////////////////////////////////////// 337 341 // 338 342 ///////////////////////////////////////////////////////////////////////////// -
mythtv/programs/mythbackend/services/dvr.h
diff --git a/mythtv/programs/mythbackend/services/dvr.h b/mythtv/programs/mythbackend/services/dvr.h index 735993d..1d60856 100644
a b class Dvr : public DvrServices 75 75 const QDateTime &StartTime, 76 76 bool Watched); 77 77 78 long GetSavedBookmark ( int RecordedId,78 long GetSavedBookmark ( int RecordedId, 79 79 int ChanId, 80 80 const QDateTime &StartTime, 81 81 const QString &OffsetType ); 82 82 83 bool SetSavedBookmark ( int RecordedId,83 bool SetSavedBookmark ( int RecordedId, 84 84 int ChanId, 85 85 const QDateTime &StartTime, 86 86 const QString &OffsetType,